struct Hoge<T> { ... } impl<T> Foo for Hoge<T> { type Item = T; } let hoge = Hoge::default(); hoge.with_type::<u32>() のように使う
trait Foo { type Item; fn with_type<T>(self) -> Self where Self: Foo<Item = T> { self } } という虚無メソッドが生えてきた
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.