pub struct LogRepository { /* private fields */ }
Expand description
Represents a devlog repository
Implementations§
Source§impl LogRepository
impl LogRepository
Sourcepub fn new(p: &Path) -> LogRepository
pub fn new(p: &Path) -> LogRepository
Creates a handle to the devlog repository at the specified path. The directory may or may not exist.
Sourcepub fn initialized(&self) -> Result<bool, Error>
pub fn initialized(&self) -> Result<bool, Error>
Checks if the repository has been initialized.
Sourcepub fn init(&self) -> Result<LogPath, Error>
pub fn init(&self) -> Result<LogPath, Error>
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.
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Returns the path to the repository directory, which may or may not exist.
Sourcepub fn list(&self) -> Result<Vec<LogPath>, Error>
pub fn list(&self) -> Result<Vec<LogPath>, Error>
Returns all paths to devlog entry files in the repository. The paths are not necessarily ordered.
Sourcepub fn tail(&self, limit: usize) -> Result<Vec<LogPath>, Error>
pub fn tail(&self, limit: usize) -> Result<Vec<LogPath>, Error>
Returns the most recent devlog entry file paths.
limit
is the maximum number of paths that may be returned.
Auto Trait Implementations§
impl Freeze for LogRepository
impl RefUnwindSafe for LogRepository
impl Send for LogRepository
impl Sync for LogRepository
impl Unpin for LogRepository
impl UnwindSafe for LogRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more