[][src]Struct devlog::repository::LogRepository

pub struct LogRepository { /* fields omitted */ }

Represents a devlog repository

Methods

impl LogRepository[src]

pub fn new(p: &Path) -> LogRepository[src]

Creates a handle to the devlog repository at the specified path. The directory may or may not exist.

pub fn initialized(&self) -> Result<bool, Error>[src]

Checks if the repository has been initialized.

pub fn init(&self) -> Result<LogPath, Error>[src]

Initializes the repository. This creates the directory if it does not exist, as well as the first devlog entry file with sequence number one. Fails with an IOError if the first devlog entry already exists.

pub fn path(&self) -> &Path[src]

Returns the path to the repository directory, which may or may not exist.

pub fn list(&self) -> Result<Vec<LogPath>, Error>[src]

Returns all paths to devlog entry files in the repository. The paths are not necessarily ordered.

pub fn tail(&self, limit: usize) -> Result<Vec<LogPath>, Error>[src]

Returns the most recent devlog entry file paths. limit is the maximum number of paths that may be returned.

pub fn latest(&self) -> Result<Option<LogPath>, Error>[src]

Returns the most recent devlog entry file path, or None if the repository has not yet been initialized.

pub fn nth_from_latest(&self, n: usize) -> Result<Option<LogPath>, Error>[src]

Returns the "nth" most recent devlog entry file path. For example, n=0 is the most recent entry, n=1 is the second most recent entry, and so on. Returns None if the repository has not yet been initialized.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,