4 ms·
Rust has the Error type. Libraries are add-ons and not part of the language.
by csomar 1y ago
Rust has the Error type. Libraries are add-ons and not part of the language.
- tialaramex 1y agoWell, Rust's standard library provides two types named Error, their full names are core::fmt::Error (aka std::fmt::Error) and std::io::Error But, neither of these is intended as "the" error type - unless you're a formatter or an I/O abstraction they're not the error types you want. Rust provides a trait core::error::Error (aka std::error::Error) and that might be what you're thinking about. It's recommended that your own private error type or types should implement this trait but nothing requires this in most contexts.