Struct geo_aid::script::unroll::MaybeUnset
source · pub struct MaybeUnset<T> { /* private fields */ }
Implementations§
source§impl<T> MaybeUnset<T>
impl<T> MaybeUnset<T>
pub fn new(default: T) -> Self
pub fn new_or(default: T, value: Option<T>) -> Self
pub fn is_set(&self) -> bool
pub fn set(&mut self, value: T)
sourcepub fn try_set(&mut self, value: Option<T>)
pub fn try_set(&mut self, value: Option<T>)
Will set the value if value
is Some
. If value
is None
, the state of the object is unchanged.
sourcepub fn set_if_unset(&mut self, value: T) -> bool
pub fn set_if_unset(&mut self, value: T) -> bool
Only sets the value if the set
flag is false.
Returns whether a new value was set.
sourcepub fn try_set_if_unset(&mut self, value: Option<T>) -> bool
pub fn try_set_if_unset(&mut self, value: Option<T>) -> bool
Only sets the value if the set
flag is false and value
is Some
.
Returns whether a new value was set.
pub fn get(&self) -> &T
pub fn unwrap(self) -> T
pub fn map<U, P: FnOnce(T) -> U>(self, f: P) -> MaybeUnset<U>
source§impl<T: Clone> MaybeUnset<T>
impl<T: Clone> MaybeUnset<T>
pub fn get_cloned(&self) -> T
pub fn cloned(&self) -> Self
source§impl<T: Copy> MaybeUnset<T>
impl<T: Copy> MaybeUnset<T>
pub fn get_copied(&self) -> T
pub fn copied(&self) -> Self
Trait Implementations§
source§impl<T> AsRef<T> for MaybeUnset<T>
impl<T> AsRef<T> for MaybeUnset<T>
source§impl<T: Clone> Clone for MaybeUnset<T>
impl<T: Clone> Clone for MaybeUnset<T>
source§fn clone(&self) -> MaybeUnset<T>
fn clone(&self) -> MaybeUnset<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for MaybeUnset<T>
impl<T: Debug> Debug for MaybeUnset<T>
source§impl<T: Default> Default for MaybeUnset<T>
impl<T: Default> Default for MaybeUnset<T>
source§impl<T> Deref for MaybeUnset<T>
impl<T> Deref for MaybeUnset<T>
source§impl From<MaybeUnset<LineType>> for AssociatedData
impl From<MaybeUnset<LineType>> for AssociatedData
source§fn from(value: MaybeUnset<LineType>) -> Self
fn from(value: MaybeUnset<LineType>) -> Self
Converts to this type from the input type.
source§impl From<MaybeUnset<Style>> for AssociatedData
impl From<MaybeUnset<Style>> for AssociatedData
source§fn from(value: MaybeUnset<Style>) -> Self
fn from(value: MaybeUnset<Style>) -> Self
Converts to this type from the input type.
source§impl From<MaybeUnset<bool>> for AssociatedData
impl From<MaybeUnset<bool>> for AssociatedData
source§fn from(value: MaybeUnset<bool>) -> Self
fn from(value: MaybeUnset<bool>) -> Self
Converts to this type from the input type.
impl<T: Copy> Copy for MaybeUnset<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for MaybeUnset<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeUnset<T>where
T: Send,
impl<T> Sync for MaybeUnset<T>where
T: Sync,
impl<T> Unpin for MaybeUnset<T>where
T: Unpin,
impl<T> UnwindSafe for MaybeUnset<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> CloneWithNode for Twhere
T: Clone,
impl<T> CloneWithNode for Twhere
T: Clone,
fn clone_with_node(&mut self) -> T
fn clone_without_node(&self) -> T
source§impl<T> Convert for T
impl<T> Convert for T
source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Errors Read more
source§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Errors Read more