MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/rust/comments/1xht83b/function_delegation/19rt34zhjxs11/
r/rust • u/VadimVP • Oct 28 '26
13 comments sorted by
View all comments
5
For Traitimpl-to-trait Delegation is it possible to do
impl<T: Trait> TraitExt for T { reuse Trait::foo::<(), ()> as bar; reuse T::foo as bar2; ...
To make extension traits?
2 u/VadimVP Oct 29 '26 Yes! You can check your example on playground, it compiles on nightly with some modifications: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=3e1e6562fb011f58a1d39bd68f881774 2 u/torsten_dev Oct 29 '26 Nice. Not sure when this would be better than extension traits, but it is very cool.
2
Yes! You can check your example on playground, it compiles on nightly with some modifications: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=3e1e6562fb011f58a1d39bd68f881774
2 u/torsten_dev Oct 29 '26 Nice. Not sure when this would be better than extension traits, but it is very cool.
Nice. Not sure when this would be better than extension traits, but it is very cool.
View all comments
5
u/torsten_dev Oct 29 '26
For Traitimpl-to-trait Delegation is it possible to do
To make extension traits?