Struct hotdrink_rs::model::Variable[][src]

pub struct Variable<T> { /* fields omitted */ }

A variable that maintains its previous values.

Implementations

impl<T> Variable<T>[src]

pub fn new(value: T) -> Self[src]

Constructs a new Variable with the specified value.

pub fn set(&mut self, value: T)[src]

Gives the variable a new value.

pub fn get(&self) -> &T[src]

Returns a reference to the current value of the variable.

pub fn get_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the current value of the variable.

pub fn undo(&mut self) -> Result<(), NoMoreUndo>[src]

Switches to the previous value of the variable.

pub fn redo(&mut self) -> Result<(), NoMoreRedo>[src]

Switches to the next value of the variable.

Trait Implementations

impl<T: Clone> Clone for Variable<T>[src]

impl<T: Debug> Debug for Variable<T>[src]

impl<T: Default> Default for Variable<T>[src]

impl<T> Deref for Variable<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Variable<T>[src]

impl<T: Eq> Eq for Variable<T>[src]

impl<T> From<T> for Variable<T>[src]

impl<T: PartialEq> PartialEq<Variable<T>> for Variable<T>[src]

impl<T> StructuralEq for Variable<T>[src]

impl<T> StructuralPartialEq for Variable<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Variable<T> where
    T: RefUnwindSafe

impl<T> Send for Variable<T> where
    T: Send

impl<T> Sync for Variable<T> where
    T: Sync

impl<T> Unpin for Variable<T> where
    T: Unpin

impl<T> UnwindSafe for Variable<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.