Skip to main content

Module result

Module result 

Source
Expand description

Parameterized outcome and resolution types.

result

Extends: std::{option, result}


Computation doesn’t just yield values, it organizes outcomes. This module refines how results, selections, and structured alternatives are formed, owned, transformed, and resolved, ensuring that every outcome finds its place.

It includes fundamental outcome types (Option, Result, OptRes), structured ownership (Own) and mismatch-aware comparisons (Mismatch).

Macros§

hook
💱 Hooks one or more mutation steps into a value and returns it.
morph
💱 Morphs a value through one or more transformation steps and returns the result.
unwrap
⚖️ An unwrapper macro that works in compile-time.

Structs§

Mismatch
⚖️ Represents a mismatch between an expected need and an encountered have.
OptionFmt
🖹 The type returned from OptionExt::fmt_or_empty.
OptionFmtOr
🖹 The type returned from OptionExt::fmt_or.
OptionFmtOrElse
🖹 The type returned from OptionExt::fmt_or_else.
Own
⚖️ A return type encapsulating an owned state S and a value V.

Enums§

Infallible
🚩 core The error type for errors that can never occur.
Option
⚗️ core A type that represents an optional value.
Result
⚖️ core A type that represents either success (Ok) or failure (Err).

Traits§

Hook
💱 Hooks operations into a value without breaking its flow.
Morph
💱 Morphs a value by threading it through a function.
OptResExt
⚖️ Extension trait providing additional methods for OptRes.
OptionExt
⚖️ Extension trait providing additional methods for Option.
ResultExt
⚖️ Extension trait providing additional methods for Result.

Functions§

serr
⚖️ Wraps the given OptRes value in a Some(Err(error)).
sok
⚖️ Wraps the given OptRes value in a Some(Ok(value)).

Type Aliases§

InfallibleResult
⚖️ 🚩 A result type whose error case can never occur.
OptRes
⚖️ An optional result type that combines success, failure, and absence.