ResultIterator

public struct ResultIterator[T, E] where T: not Static { /* private fields */ }

Associated Types

type Item = T

Initializers

public init(Result[T, E])

Builds an iterator from a Result, projecting .Ok to a single element and .Err to an empty stream.

Methods

public mutating func next() -> Optional[T]

Returns and clears the stored value, then returns None forever. O(1) and allocation-free.

Defined in lang/std/result/result.ks