Struct sbvc_lib::Version[][src]

pub struct Version(_);
Expand description

A struct that represents a single commit in the version tree. It uses Arc under the hood, so it is okay to clone it, as it has very little cost.

Implementations

Returns contents of the controlled file in given version.

This method does not cache anything or use any cached values. Instead, it calculates contents of the file every time this method is called using differences contained in the database, so you should either cache contents yourself, or do not call this method very often.

Deletes given version and all its children from the version tree.

Errors

This method returns an error if error happens while deleting records from the database.

Rolls the controlled file back to its state at given version.

Errors

This method returns an error if an IO error occurs while trying to write into the file.

Renames the version to given name.

Errors

This method returns an error if an error occurs while trying to update values in the database.

Commits file’s new state into the version tree.

The new version will be child of self.

Errors

This method returns an error if an error occurs while trying to insert values into the database.

Returns ID of the version.

Returns parent version of self. Returns None if there is none.

Returns name of the version.

Returns date when the version was commited.

This method returns String representation of the date in the same format it was stores in the database.

Returns number of deletions from the file in this version.

Returns number of insertions into the file in this version.

Returns all the children of the version.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.