Skip to main content

ValueType

Struct ValueType 

Source
pub struct ValueType<T>
where T: Clone + PartialEq,
{ /* private fields */ }
Expand description

Value type like a memory undo/redo type. Rundo will clone its origin value as a backup, so Clone must be implemented. Be careful use it for struct or other big size type, OpType is design for this scenario, or you must implment your custrom rundo type.

Trait Implementations§

Source§

impl<T> AsMut<T> for ValueType<T>
where T: 'static + Clone + PartialEq,

Source§

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<T> AsRef<T> for ValueType<T>
where T: 'static + Clone + PartialEq,

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Deref for ValueType<T>
where T: Clone + PartialEq,

impl Deref let ValueType transparent to user access T value.

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<T> DerefMut for ValueType<T>
where T: Clone + PartialEq,

when user try to get a mut refercence, Rundo know what changed in the later.

Source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
Source§

impl<T> From<T> for ValueType<T>
where T: Clone + PartialEq,

Source§

fn from(from: T) -> Self

Converts to this type from the input type.
Source§

impl<T> Rundo for ValueType<T>
where T: Clone + PartialEq + Debug + Primitive,

Source§

type Op = VtOp<T>

Source§

fn dirty(&self) -> bool

if this node has been changed between from the last step to current.
Source§

fn reset(&mut self)

Reset the node change state which mean changes has been record by workspace, or changes will be ignore.
Source§

fn change_op(&mut self) -> Option<Self::Op>

Use Op to describe the change infos.
Source§

fn back(&mut self, op: &Self::Op)

Use an Op and back to the previous data status
Source§

fn forward(&mut self, op: &Self::Op)

Go to the next version of the data should be with a Op.
Source§

impl Rundo for ValueType<String>

Source§

type Op = Vec<StrOP>

Source§

fn dirty(&self) -> bool

if this node has been changed between from the last step to current.
Source§

fn reset(&mut self)

Reset the node change state which mean changes has been record by workspace, or changes will be ignore.
Source§

fn change_op(&mut self) -> Option<Self::Op>

Use Op to describe the change infos.
Source§

fn back(&mut self, op: &Self::Op)

Use an Op and back to the previous data status
Source§

fn forward(&mut self, op: &Self::Op)

Go to the next version of the data should be with a Op.

Auto Trait Implementations§

§

impl<T> Freeze for ValueType<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ValueType<T>
where T: RefUnwindSafe,

§

impl<T> Send for ValueType<T>
where T: Send,

§

impl<T> Sync for ValueType<T>
where T: Sync,

§

impl<T> Unpin for ValueType<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for ValueType<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for ValueType<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.