pub struct OptionChain<T> { /* private fields */ }Expand description
A builder-style wrapper for chaining option operations.
Provides a fluent API for building complex option expressions.
Implementations§
Source§impl<T> OptionChain<T>
impl<T> OptionChain<T>
Sourcepub fn map<U>(self, f: impl FnOnce(T) -> U) -> OptionChain<U>
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> OptionChain<U>
Apply a map operation.
Sourcepub fn flat_map<U>(self, f: impl FnOnce(T) -> Option<U>) -> OptionChain<U>
pub fn flat_map<U>(self, f: impl FnOnce(T) -> Option<U>) -> OptionChain<U>
Apply a flatmap operation.
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Check if this chain has a value.
Auto Trait Implementations§
impl<T> Freeze for OptionChain<T>where
T: Freeze,
impl<T> RefUnwindSafe for OptionChain<T>where
T: RefUnwindSafe,
impl<T> Send for OptionChain<T>where
T: Send,
impl<T> Sync for OptionChain<T>where
T: Sync,
impl<T> Unpin for OptionChain<T>where
T: Unpin,
impl<T> UnsafeUnpin for OptionChain<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for OptionChain<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more