{"url":"https://bamch0h.hatenablog.com/entry/2022/10/06/230801","published":"2022-10-06 23:08:01","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbamch0h.hatenablog.com%2Fentry%2F2022%2F10%2F06%2F230801\" title=\" \u30c8\u30ec\u30a4\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3059\u95a2\u6570\u306e\u4f5c\u6210 - bamchoh\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","author_name":"bamch0h","blog_title":"bamchoh\u2019s diary","height":"190","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","blog_url":"https://bamch0h.hatenablog.com/","description":"Box\u3067\u304f\u304f\u3063\u3066\u3001dyn \u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u3064\u3051\u308b\u306e\u304c\u30df\u30bd trait Animal { fn cry(&self); } struct Dog {} impl Animal for Dog { fn cry(&self) { println!(\"\u30ef\u30f3\"); } } struct Cat {} impl Animal for Cat { fn cry(&self) { println!(\"\u306b\u3083\u3093\"); } } fn new_animal(animal: &str) -> Box<dyn Animal> { if animal == \"Dog\" { Box::new(Dog{}) } else { B\u2026","title":" \u30c8\u30ec\u30a4\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3059\u95a2\u6570\u306e\u4f5c\u6210","categories":["Rust"],"type":"rich","image_url":null,"author_url":"https://blog.hatena.ne.jp/bamch0h/","width":"100%"}