pub struct Versioned<T> { /* private fields */ }
Expand description

A wrapper around data, that tracks mutable changes using mutable dereference counting.

Implementations§

Create a new instance of Self with an internal version.

Creates a new instance of Self with a provided version.

Returns current version.

Trait Implementations§

Returns mutable reference to the value. Increments version.

Returns reference to the value. Does not increment version.

Proxy clone call, that creates a new tracked version of T by cloning T. THe version is not cloned, and a new version is created.

Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Proxy default call, that creates a version tracker T with a default value.

Dereferences the value. Does not increment version.

The resulting type after dereferencing.

Mutably dereferences the value. Increments version.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.