Antra

Standardbibliothek

Antra::Unwrap

import Antra::Unwrap

Unwrap protocol for postfix expr.?.

Antra::Unwrap defines the protocol behind soft unwrapping. Unlike Antra::Propagate (postfix .^), .? never propagates or throws: implementations return the unwrapped value directly, or undef when there is nothing to unwrap. See Antra::Unwrap::Result for %Ok[...] / %Err[...] and Antra::Unwrap::Option for %Some[...] / %None[].

Protokolle#

Unwrapprotocol</>
protocol Unwrap {
    fn __unwrap__(value)
}

Protocol for values that can be softly unwrapped by postfix .?.

Quelle dieser Seite