本当は trait FooResult: Foo<Item=Result<Self::Ok, Self::Err>> { type Ok; type Err; } と書きたかったがこれだと定義が循環してしまう。なので,代わりに Foo という関連型を用意しそこに諸々のトレイト境界をかけ,そのうえで Self ->Self::Foo への「変換」を挿入したという話です
説明が難しいのだが、最終的にこんな感じでトレイトの循環定義に関する問題を回避したりしてた https://gist.github.com/rust-play/8a1dc9dad9a96b6a3dc1e5bb40f2510f …
-
-
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.