rok::core::error
rok::core::error - Result<T, E>, an error kept as a value.
Errors travel through throws / try (spec 4.14); Result is for
holding one (collected results, callbacks, caches): "throw it →
throws; keep it → Result". ? does not apply to it (T | none
only).
Ok / Err are bare names everywhere through the implicit
use rok::core::** (variants are reachable by globs).
Structs
ParseError
pub struct ParseErrorA str that is not a valid value of the requested type (stdlib
spec 2.14.4; thrown by str::parse / FromStr).
pub input: strpub pos: usizepub reason: str
Trait implementations 3
impl Display for ParseErrorimpl Debug for ParseErrorimpl Error for ParseError
ValueError
pub struct ValueErrorAn invalid argument value (stdlib spec 2.14.4;
char::to_digit, ...).
pub msg: str
Trait implementations 3
impl Display for ValueErrorimpl Debug for ValueErrorimpl Error for ValueError
OverflowError
pub struct OverflowErrorA value out of a fixed-width type's range in a checked conversion
(stdlib spec 2.14.4; thrown by try_from / try_into).
pub op: str"try_from", ...pub ty: strThe target type:
"i32", ...
Trait implementations 3
impl Display for OverflowErrorimpl Debug for OverflowErrorimpl Error for OverflowError
ConversionError
pub struct ConversionErrorA failed TryFrom conversion: the trait's default Error (stdlib
spec 2.11.4) for impls that name no more specific one.
pub msg: str
Trait implementations 3
impl Display for ConversionErrorimpl Debug for ConversionErrorimpl Error for ConversionError
TypeError
pub struct TypeErrorA value of the wrong type (stdlib spec 2.14.4).
pub expected: strpub actual: str
Trait implementations 3
impl Display for TypeErrorimpl Debug for TypeErrorimpl Error for TypeError
IndexError
pub struct IndexErrorAn index out of range in a throwing API (stdlib spec 2.14.4;
List::set). xs[i] out of range panics instead.
pub index: i64pub len: usize
Trait implementations 3
impl Display for IndexErrorimpl Debug for IndexErrorimpl Error for IndexError
StackOverflowError
pub struct StackOverflowErrorTrait implementations 3
impl Display for StackOverflowErrorimpl Debug for StackOverflowErrorimpl Error for StackOverflowError
OutOfMemoryError
pub struct OutOfMemoryErrorTrait implementations 3
impl Display for OutOfMemoryErrorimpl Debug for OutOfMemoryErrorimpl Error for OutOfMemoryError
InternalError
pub struct InternalErrorTrait implementations 3
impl Display for InternalErrorimpl Debug for InternalErrorimpl Error for InternalError
Enums
Result
pub enum Result<TTraits
Error
pub trait Error: Display + DebugEvery error type's surface (stdlib spec 2.14.3). Untyped throws
means throws (any Error).
const fn source(self) -> any Error | noneThe error that caused this one, if any.