Archive

Struct Archive 

Source
pub struct Archive {
    pub itver: u16,
    /* private fields */
}

Fields§

§itver: u16

Implementations§

Source§

impl Archive

Source

pub fn init(logger: impl Logger) -> Self

Initialises a new archive, will throw error if one already exists

Source

pub fn load(logger: impl Logger) -> Self

Loads an archive at the cli’s home

Source

pub fn load_dir(path: PathBuf, logger: impl Logger) -> Self

Loads an archive at a specified path

Source

pub fn rollback(force: bool, logger: impl Logger)

Rolls back to last backup

Source

pub fn backup(out_path: impl AsRef<Path>, logger: impl Logger)

Backs up home archive to specified path

Source

pub fn load_backup(path: impl AsRef<Path>, force: bool, logger: impl Logger)

Loads a backup if that backup is the same as the active archive and or newer than the active archive, otherwise errors will be thrown

Source

pub fn wipe(self, logger: impl Logger)

Wipes the specified archive and asks the user for confirmation

Source

pub fn commit(&self, config: impl AsRef<Path>, logger: impl Logger)

Source

pub fn database(&self) -> &LazyDB

Source

pub fn database_exists(&self, path: impl AsRef<Path>) -> bool

Source

pub fn get_entry(&self, uid: String, logger: impl Logger) -> Option<Entry>

Source

pub fn get_moc(&self, uid: String, logger: impl Logger) -> Option<MOC>

Source

pub fn list_entries(&self, logger: impl Logger) -> Vec<Entry>

Source

pub fn list_mocs(&self, logger: impl Logger) -> Vec<MOC>

Auto Trait Implementations§

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<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<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.