SlideShare a Scribd company logo
Live Without
Exceptions In
Rust
Presented By: Ayush Kumar Mishra
Sr. Lead Consultant
Knoldus Inc.
LEARN NOW
About Knoldus
Knoldus is a technology consulting firm with focus on modernizing the digital systems
at the pace your business demands.
DevOps
Functional. Reactive. Cloud Native
01 Introduction to Rust
02 Dealing with Exception handling in Other Languages
03 Live without Exception in Rust
04 Error Handling in Rust
Our Agenda
1
2
3
4
Best known for being a system language
Doesn't have Garbage Collection
It has its own package manager Cargo
Focused on safety, speed, and concurrency
“A systems programming
language that runs blazingly
fast, prevents segfaults, and
guarantees thread safety. ”
Introduction to Rust
Strict exception
handling
Java01
Exceptions-agnostic
C
03
Weak exception
handling
C++, Python, Ruby
02
By monadic types
Rust, Scala, Swift04
Dealing with Exception handling in
Other Languages
Live without Exception in Rust
Live without Exception in Rust
1 Rust doesn’t support throwing exceptions, nor does it support catching them
Live without Exception in Rust
2 Exceptions bubble up by default, which may be surprising / unexpected
Live without Exception in Rust
3 Rust does not use the concept of null nil undefined types
enum Result<T, E> {
Ok(T),
Err(E),
}
enum Option<T> {
None,
Some(T),
}
Live without Exception in Rust
4 In Rust, there is no way for code to interact with objects in an invalid state
BANNER INFOGRAPHICInsert Your Subtitle Here
Unrecoverable01
Recoverable 02
fn main() {
panic!("Quit from here!");
}
fn parse_string_to_int(str: &str) {
match str.parse::<i32>() {
Ok(t) => println!("Here is parsed integer {}!", t),
Err(e) => println!("There was a problem {:?}", e),
};
}
Error Handling in Rust
BANNER INFOGRAPHICInsert Your Subtitle Here
When to use panic!
When the panic! macro executes
1) When there is some unexpected error
2) When we are not using any debugger or proper logs
1) Unwinding
2) Aborting (panic = 'abort')
panic!
Option<T> or Result<T, E>
fn match_color(color: Option<&str>) {
match color {
Some("Red") => println!("Hey I got Red T-shirt"),
Some(c) => println!("I don't like {} T-shirt", c),
None => println!("No T-shirt"),
}
}
fn parse_string_to_int(str: &str) {
match str.parse::<i32>() {
Ok(t) => println!("Here is parsed integer {}!", t),
Err(e) => println!("There is a problem {:?}", e),
};
}
01
References
https://doc.rust-lang.org/book/ch09-00-error-handling.html
https://medium.com/learning-rust/rust-error-handling-72a8e036dd3
https://stevedonovan.github.io/rust-gentle-intro/6-error-handling.html
https://dev.to/saiumesh/error-handling-in-rust-programming-language-3g4
https://blog.knoldus.com/you-can-live-without-exceptions-if-you-are-using-rust/
Subscribe
Thank You!
@ayushmishra2005
ayush@knoldus.com

More Related Content

PDF
Ia+ threading
PPTX
Introduction To Rust part II Presentation
PPTX
Why Is Rust Gaining Traction In Recent Years?
PPTX
Why Hiring Rust Developers Can Reduce Technical Debt & Save Millions.pptx
PDF
Introduction-to-Rust-No - Watermark.pdf
PDF
Introduction-to-Rust. pdf
PPTX
First Ride on Rust
PDF
Rust and Eclipse
Ia+ threading
Introduction To Rust part II Presentation
Why Is Rust Gaining Traction In Recent Years?
Why Hiring Rust Developers Can Reduce Technical Debt & Save Millions.pptx
Introduction-to-Rust-No - Watermark.pdf
Introduction-to-Rust. pdf
First Ride on Rust
Rust and Eclipse

Similar to Webinar: Live without Exception in Rust (20)

ODP
Rust Primer
PDF
intro_to_rust.pptx_123456789012446789.pdf
PPTX
Rust presentation convergeconf
PPTX
Intro to Rust for Solana.pptx
PPTX
MozillaPH Rust Hack & Learn Session 1
PPTX
Introduction to Rust - Admios ALTalk Nov 2018
PDF
Rust All Hands Winter 2011
PDF
RUSTing -- Partially Ordered Rust Programming Ruminations
PPTX
Once Upon a Process
PPTX
Rust Intro
PDF
Why rust?
PDF
How Rust Views Tradeoffs
PPTX
Introduction to Rust (Presentation).pptx
PDF
Introduction to rust: a low-level language with high-level abstractions
PDF
What to Look for When Hiring a Rust Software Developer in 2025?
PPTX
Go/Ruby/Java: What's next?
PPTX
Rust programming-language
PPTX
MozillaPH Rust Hack & Learn Session 2
PPTX
Why Hiring Rust Developers is a Smart Investment for Tech Companies.pptx
PDF
Intro to Rust 2019
Rust Primer
intro_to_rust.pptx_123456789012446789.pdf
Rust presentation convergeconf
Intro to Rust for Solana.pptx
MozillaPH Rust Hack & Learn Session 1
Introduction to Rust - Admios ALTalk Nov 2018
Rust All Hands Winter 2011
RUSTing -- Partially Ordered Rust Programming Ruminations
Once Upon a Process
Rust Intro
Why rust?
How Rust Views Tradeoffs
Introduction to Rust (Presentation).pptx
Introduction to rust: a low-level language with high-level abstractions
What to Look for When Hiring a Rust Software Developer in 2025?
Go/Ruby/Java: What's next?
Rust programming-language
MozillaPH Rust Hack & Learn Session 2
Why Hiring Rust Developers is a Smart Investment for Tech Companies.pptx
Intro to Rust 2019
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.
Ad

Recently uploaded (20)

PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Mushroom cultivation and it's methods.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Approach and Philosophy of On baking technology
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A comparative study of natural language inference in Swahili using monolingua...
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
NewMind AI Weekly Chronicles - August'25-Week II
TLE Review Electricity (Electricity).pptx
Mushroom cultivation and it's methods.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Encapsulation_ Review paper, used for researhc scholars
Univ-Connecticut-ChatGPT-Presentaion.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Chapter 5: Probability Theory and Statistics
Programs and apps: productivity, graphics, security and other tools
Group 1 Presentation -Planning and Decision Making .pptx
WOOl fibre morphology and structure.pdf for textiles
Approach and Philosophy of On baking technology
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
1 - Historical Antecedents, Social Consideration.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Webinar: Live without Exception in Rust