devela::code

Module result

Source
Expand description

Result handling.
result::{error}

Extends: std::{backtrace, error, option, panic, result}


Streamlines error management, result chaining, and introduces utility types and macros.

Modules§

  • Error-related types and traits.

Macros§

  • core Causes compilation to fail with the given error message when encountered.
  • core Panics the current thread.
  • core Indicates unfinished code.
  • core Indicates unimplemented code.
  • core Indicates unreachable code.
  • An unwrapper macro that works in compile-time.

Structs§

Enums§

  • std The current status of a backtrace.
  • ⚖️ core A type that represents either success (Ok) or failure (Err).

Traits§

  • Allows chaining transformations by passing values through a sequence of functions.
  • Extension trait providing additional methods for OptRes.
  • Extension trait providing additional methods for Option.
  • Extension trait providing additional methods for Result.
  • Allows attaching operations or side effects to a value without breaking its flow.
  • core A marker trait which represents a shared reference considered unwind safe.
  • core A marker trait which represents “panic safe” types in Rust.

Functions§

  • std Panic the current thread with the given message as the panic payload.
  • std Invokes a closure, capturing the cause of an unwinding panic if one occurs.
  • std Triggers a panic without invoking the panic hook.
  • std Registers a custom panic hook, replacing the previously registered hook.
  • std Unregisters the current panic hook, returns it and registers the default hook in its place.
  • Wraps the given OptRes value in a Some(Err(error)).
  • Wraps the given OptRes value in a Some(Ok(value)).

Type Aliases§

  • An optional result for simple ternary logic.