{"type":"rich","author_url":"https://blog.hatena.ne.jp/inon29/","published":"2023-10-22 13:25:48","provider_name":"Hatena Blog","image_url":null,"height":"190","blog_url":"https://inon29.hateblo.jp/","description":"Rust\u306b\u304a\u3051\u308bResult\u3092\u4f7f\u3063\u305f\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u57fa\u672c\u7684\u306a\u90e8\u5206\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u304a\u304f\u3002 Result\u578b doc.rust-lang.org Rust\u306b\u306f\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u305f\u3081\u306e\u7279\u5225\u306a\u578b\u3001Result\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3002 enum Result<T, E> { Ok(T), Err(E), } Ok\u30d0\u30ea\u30a2\u30f3\u30c8\u306f\u64cd\u4f5c\u304c\u6210\u529f\u3057\u305f\u5834\u5408\u306b\u4f7f\u7528\u3055\u308c\u3001Err\u30d0\u30ea\u30a2\u30f3\u30c8\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306b\u4f7f\u7528\u3055\u308c\u308b\u3002 [\u4f8b] use std::fs; use std::io; fn read_file_content(file_path: &str) -> Result<String, io::Error> { \u2026","version":"1.0","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finon29.hateblo.jp%2Fentry%2F2023%2F10%2F22%2F132548\" title=\"Rust\u306b\u3088\u308bResult\u578b\u306e\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5165\u9580 - It\u2019s now or never\" 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\u306b\u3088\u308bResult\u578b\u306e\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5165\u9580","author_name":"inon29","width":"100%","url":"https://inon29.hateblo.jp/entry/2023/10/22/132548","categories":["Rust"],"blog_title":"It\u2019s now or never"}