[−][src]Struct devlog::repository::LogRepository
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
impl Send for LogRepository
impl Unpin for LogRepository
impl Sync for LogRepository
impl UnwindSafe for LogRepository
impl RefUnwindSafe for LogRepository
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,