pub struct LogosOpt<T>(pub Option<T>);Expand description
A value of T, or nothing.
Tuple Fields§
§0: Option<T>Implementations§
Source§impl<T> LogosOpt<T>
impl<T> LogosOpt<T>
Sourcepub fn is_nothing(&self) -> bool
pub fn is_nothing(&self) -> bool
Whether it holds nothing.
Sourcepub fn held(&self, failure: &str) -> &T
pub fn held(&self, failure: &str) -> &T
The value it holds. Holding nothing, the program stops with failure.
Sourcepub fn held_mut(&mut self, failure: &str) -> &mut T
pub fn held_mut(&mut self, failure: &str) -> &mut T
The value it holds, to change in place. Holding nothing, the program stops with failure.
Sourcepub fn into_held(self, failure: &str) -> T
pub fn into_held(self, failure: &str) -> T
The value it holds, taken. Holding nothing, the program stops with failure.
Sourcepub fn pair<U>(
left: LogosOpt<T>,
right: LogosOpt<U>,
failures: [&str; 3],
) -> (T, U)
pub fn pair<U>( left: LogosOpt<T>, right: LogosOpt<U>, failures: [&str; 3], ) -> (T, U)
The values two operands hold, for an operation on both, each evaluated before either is read. Either holding
nothing, the program stops with failures: the words for the left one alone, the right one alone, and both.
Trait Implementations§
Source§impl<T: Default> Default for LogosOpt<T>
A place starts holding its type’s own first value, as the VM’s does.
impl<T: Default> Default for LogosOpt<T>
A place starts holding its type’s own first value, as the VM’s does.
Source§impl<T: Truthy> Truthy for LogosOpt<T>
nothing is false where a condition reads it, and a value is as true as it is.
impl<T: Truthy> Truthy for LogosOpt<T>
nothing is false where a condition reads it, and a value is as true as it is.
impl<T: Eq> Eq for LogosOpt<T>
impl<T> StructuralPartialEq for LogosOpt<T>
Auto Trait Implementations§
impl<T> Freeze for LogosOpt<T>where
T: Freeze,
impl<T> RefUnwindSafe for LogosOpt<T>where
T: RefUnwindSafe,
impl<T> Send for LogosOpt<T>where
T: Send,
impl<T> Sync for LogosOpt<T>where
T: Sync,
impl<T> Unpin for LogosOpt<T>where
T: Unpin,
impl<T> UnsafeUnpin for LogosOpt<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LogosOpt<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.