TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rust: Error Handling – Learning Rust V

4 点作者 dumindunuwan超过 6 年前

1 comment

dumindunuwan超过 6 年前
Hi Guys,<p>This is the fifth post I wrote about Learning Rust on Medium, <a href="https:&#x2F;&#x2F;medium.com&#x2F;learning-rust" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;learning-rust</a>. Now you can read the same content via <a href="https:&#x2F;&#x2F;learning-rust.github.io" rel="nofollow">https:&#x2F;&#x2F;learning-rust.github.io</a> as well. In this post, I tried to summarize about,<p><pre><code> - Smart Compiler - Why Compiler? - Explain Error Codes - Panicking - panic!() - unimplemented!() - unreachable!() - assert!(), assert_eq!(), assert_ne!() - debug_assert!(), debug_assert_eq!(), debug_assert_ne!() - Option and Result - Why Option and Result? - Basic usages of Option - Basic usages of Result - is_some(), is_none(), is_ok(), is_err() - ok(), err() for Result types - Unwrap and Expect - unwrap() - expect() - unwrap_err() and expect_err() for Result types - unwrap_or(), unwrap_or_default() and unwrap_or_else() - Error and None Propagation - ? Operator - try!() - Error propagation from main() - Combinators - What is a combinator? - or() and and() - or_else() - and_then() - filter() - map() and map_err() - map_or() and map_or_else() - ok_or() and ok_or_else() - as_ref() and as_mut() - Custom Error Types - Error trait - From trait </code></pre> &gt; I am a Sri Lankan🇱🇰 Web Developer who works in Vietnam🇻🇳. I am not a native English speaker and I am just practicing Rust in my very little leisure time, while learning more about Golang, Devops and so much in the workplace. So, if you found any mistake or something I need to be changed, even a spelling or a grammar mistake, please let me know.<p>⭐ Hire me! - <a href="https:&#x2F;&#x2F;github.com&#x2F;dumindu&#x2F;hire-me&#x2F;blob&#x2F;master&#x2F;resume_dumindu_madunuwan.pdf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dumindu&#x2F;hire-me&#x2F;blob&#x2F;master&#x2F;resume_dumind...</a><p>⭐ Buy me a coffee! - <a href="https:&#x2F;&#x2F;www.buymeacoffee.com&#x2F;dumindu" rel="nofollow">https:&#x2F;&#x2F;www.buymeacoffee.com&#x2F;dumindu</a><p>⭐ Contribute! - <a href="http:&#x2F;&#x2F;learning-rust.github.io" rel="nofollow">http:&#x2F;&#x2F;learning-rust.github.io</a><p>Thanks