Struct version_track::Version

source ·
pub struct Version { /* private fields */ }
Expand description

Tracks the changing state of the rebase file

Implementations§

Creates a sentinel Self, that is useful as an initial non-version for caching. Any changes to this version will reset the internal state to a new value. Internally, this uses a Uuid with the maximum valid value, and an increment of usize::MAX.

See SENTINEL_VERSION for a constant sentinel value.

Create a new Self instance with a random Uuid and an increment of 0.

Reset to an initial state, with a new internal version tracker.

Increment the internal internal version, if the increment overflows, then the internal Uuid is recreated with a new value, and the increment is set to 0.

See Self::increment_wrap for a version that does not update the internal Uuid on overflow.

Increment the internal internal version, if the increment overflows, the increment resets to 0. This allows the internal Uuid to remain stable, and reusing older increments are okay.

See Self::increment for a version that refreshes the internal Uuid on overflow.

Check if the internal Uuid is the same for this version and another. This is useful for checking if the state being treated by this instance is the same as another.

Note that using Self::reset or Self::increment can update the internal Uuid, and result in this value returning false.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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.