{"provider_url":"https://hatena.blog","blog_title":"in neuro","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fin-neuro.hatenablog.com%2Fentry%2F2019%2F01%2F20%2F210653\" title=\"Rust\u3067trait\u306eassociated type\u306b\u5bfe\u3057\u3066trait boundary\u3092\u8ab2\u3059 - in neuro\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"Rust\u3067trait\u306eassociated type\u306b\u5bfe\u3057\u3066trait boundary\u3092\u8ab2\u3059","blog_url":"https://in-neuro.hatenablog.com/","categories":["Rust"],"provider_name":"Hatena Blog","type":"rich","url":"https://in-neuro.hatenablog.com/entry/2019/01/20/210653","version":"1.0","height":"190","published":"2019-01-20 21:06:53","description":"Rust\u306eTrait\u306f\u5185\u90e8\u306b\u578b\u3092\u6301\u3064\u3053\u3068\u304c\u3042\u308b\u3002\u95a2\u9023\u578b\uff08associated type\uff09\u3060 trait Hoge { type Value; } impl Hoge for Piyo { type Value = Fuga; } \u3053\u306eValue\u578b\u306b\u3064\u3044\u3066\u30c8\u30ec\u30a4\u30c8\u5883\u754c\u3092\u4ed8\u3051\u305f\u3044\u3002 \u3064\u307e\u308a\u3001\u3042\u308b\u578bT\u304c\u3042\u308a\u3001\u578b<T as Hoge>::Value\u304cOtherTrait\u3092\u6e80\u305f\u3059\u5834\u5408\u306e\u307f\u4f7f\u3048\u308b\u95a2\u6570\u3092\u4f7f\u3044\u305f\u3044\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3051\u305f\u3089\u3088\u3044\u306e\u3060\u304c\u3002 fn foo<T: Hoge<Value: OtherTrait>>() -> () { // ... } \u6b8b\u5ff5\u306a\u304c\u3089\u3053\u308c\u306f\u901a\u3089\u306a\u3044\u3002 error: expect\u2026","author_url":"https://blog.hatena.ne.jp/tniina/","image_url":null,"width":"100%","author_name":"tniina"}