rokdocs
v0.1

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 ParseError

A str that is not a valid value of the requested type (stdlib spec 2.14.4; thrown by str::parse / FromStr).

  • pub input: str
  • pub pos: usize
  • pub reason: str
Trait implementations 3
  • impl Display for ParseError
  • impl Debug for ParseError
  • impl Error for ParseError

ValueError

pub struct ValueError

An invalid argument value (stdlib spec 2.14.4; char::to_digit, ...).

  • pub msg: str
Trait implementations 3
  • impl Display for ValueError
  • impl Debug for ValueError
  • impl Error for ValueError

OverflowError

pub struct OverflowError

A 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: str

    The target type: "i32", ...

Trait implementations 3
  • impl Display for OverflowError
  • impl Debug for OverflowError
  • impl Error for OverflowError

ConversionError

pub struct ConversionError

A 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 ConversionError
  • impl Debug for ConversionError
  • impl Error for ConversionError

TypeError

pub struct TypeError

A value of the wrong type (stdlib spec 2.14.4).

  • pub expected: str
  • pub actual: str
Trait implementations 3
  • impl Display for TypeError
  • impl Debug for TypeError
  • impl Error for TypeError

IndexError

pub struct IndexError

An index out of range in a throwing API (stdlib spec 2.14.4; List::set). xs[i] out of range panics instead.

  • pub index: i64
  • pub len: usize
Trait implementations 3
  • impl Display for IndexError
  • impl Debug for IndexError
  • impl Error for IndexError

StackOverflowError

pub struct StackOverflowError
Trait implementations 3
  • impl Display for StackOverflowError
  • impl Debug for StackOverflowError
  • impl Error for StackOverflowError

OutOfMemoryError

pub struct OutOfMemoryError
Trait implementations 3
  • impl Display for OutOfMemoryError
  • impl Debug for OutOfMemoryError
  • impl Error for OutOfMemoryError

InternalError

pub struct InternalError
Trait implementations 3
  • impl Display for InternalError
  • impl Debug for InternalError
  • impl Error for InternalError

Enums

Result

pub enum Result<T

Traits

Error

pub trait Error: Display + Debug

Every error type's surface (stdlib spec 2.14.3). Untyped throws means throws (any Error).

  • const fn source(self) -> any Error | none

    The error that caused this one, if any.