Ahhh, awesome! There's a thread about this exact topic! 
https://internals.rust-lang.org/t/new-rfc-for-delegation-anyone-interested-in-contributing/6644 …
I still find it tricky in Rust to delegate methods from one struct into another internal struct. The delegate crate seems alright, but it feels like this is a thing that could use a solution at the language level. People have suggested looking into Julia. Maybe we should?
-
-
Show this thread
-
Ohhhh, okay this only works for traits! I was thinking specifically about BLAKE2b here. Completely different: but a trait version of that would be perfect! Would make serializing to/from disk great :D Okay, I'm super excited about the way all these things could come together :D
Show this thread -
Ahhh, awesome! Think I just figured out how to eliminate the need to expose "NodeTrait" in Hypercore. https://docs.rs/hypercore/0.3.2/hypercore/ … I think if we create an external wrapper for the Node type, we can confine the use of `NodeTrait` to Hypercore's internals. Pretty? No. But it works!
Show this thread -
I think this is different from the "delegate stuff" in the post above. If I recall correctly this is about sealed/sealing structs. Related, but different. Wish there would be some good solutions for this too though; right now it's going to require a lot of boilerplate :(
Show this thread -
Heh, funny enough there _is_ a delegate crate out there that seems to tick all boxes. Think I'll try & use this to create an internal / external type :D https://github.com/chancancode/rust-delegate …
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.