pub struct Halt<Q>(pub Q);Tuple Fields§
§0: QImplementations§
Source§impl<Q> Halt<Q>
impl<Q> Halt<Q>
pub fn new(halt: Q) -> Self
Sourcepub const fn get_ref(&self) -> &Q
pub const fn get_ref(&self) -> &Q
Returns an immutable reference to the inner value of the halted state.
Sourcepub fn get_mut(&mut self) -> &mut Q
pub fn get_mut(&mut self) -> &mut Q
Returns a mutable reference to the inner value of the halted state.
Sourcepub fn replace(&mut self, halt: Q) -> Q
pub fn replace(&mut self, halt: Q) -> Q
Replaces the inner value of the halted state with the given value, returning the previous value.
Sourcepub fn reset(&mut self)where
Q: Default,
pub fn reset(&mut self)where
Q: Default,
Resets the inner value of the halted state to the default value of the type.
Sourcepub fn set(&mut self, halt: Q)
pub fn set(&mut self, halt: Q)
Sets the inner value of the halted state to that of the given value.
Sourcepub fn swap<S>(&mut self, other: &mut S)where
S: Stated<Item = Q>,
pub fn swap<S>(&mut self, other: &mut S)where
S: Stated<Item = Q>,
Swaps the inner value of the halted state with that of the given state.
Sourcepub fn take(&mut self) -> Qwhere
Q: Default,
pub fn take(&mut self) -> Qwhere
Q: Default,
Takes the inner value of the halted state and replaces it with the default value of the type.
Sourcepub fn as_state(&self) -> State<Halt<&Q>>
pub fn as_state(&self) -> State<Halt<&Q>>
Converts the halted state into a new State with an immutable reference to the inner value.
Sourcepub fn as_state_mut(&mut self) -> State<Halt<&mut Q>>
pub fn as_state_mut(&mut self) -> State<Halt<&mut Q>>
Converts the halted state into a new State with a mutable reference to the inner value.
Sourcepub fn into_state(self) -> State<Halt<Q>>
pub fn into_state(self) -> State<Halt<Q>>
Wraps the halted state and returns a new State
Trait Implementations§
Source§impl<'de, Q> Deserialize<'de> for Halt<Q>where
Q: Deserialize<'de>,
impl<'de, Q> Deserialize<'de> for Halt<Q>where
Q: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<Q: Ord> Ord for Halt<Q>
impl<Q: Ord> Ord for Halt<Q>
Source§impl<Q: PartialOrd> PartialOrd for Halt<Q>
impl<Q: PartialOrd> PartialOrd for Halt<Q>
impl<Q: Copy> Copy for Halt<Q>
impl<Q: Eq> Eq for Halt<Q>
impl<Q> StructuralPartialEq for Halt<Q>
Auto Trait Implementations§
impl<Q> Freeze for Halt<Q>where
Q: Freeze,
impl<Q> RefUnwindSafe for Halt<Q>where
Q: RefUnwindSafe,
impl<Q> Send for Halt<Q>where
Q: Send,
impl<Q> Sync for Halt<Q>where
Q: Sync,
impl<Q> Unpin for Halt<Q>where
Q: Unpin,
impl<Q> UnwindSafe for Halt<Q>where
Q: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more