pub struct LogPath { /* private fields */ }
Implementations§
Source§impl LogPath
Devlog entry files are numbered sequentially, starting from one.
Each filename is nine digits with the extension “.devlog”; for example, “000000123.devlog”.
This ensures that the devlog files appear in sequential order when sorted alphabetically.
impl LogPath
Devlog entry files are numbered sequentially, starting from one. Each filename is nine digits with the extension “.devlog”; for example, “000000123.devlog”. This ensures that the devlog files appear in sequential order when sorted alphabetically.
Sourcepub fn new(dir: &Path, seq_num: usize) -> LogPath
pub fn new(dir: &Path, seq_num: usize) -> LogPath
Create a new path with the specified sequence number, which must be at least one
and at most MAX_SEQ_NUM
.
Sourcepub fn from_path(path: PathBuf) -> Option<LogPath>
pub fn from_path(path: PathBuf) -> Option<LogPath>
Parse the sequence number from a filesystem path.
Returns None
if the filename isn’t formatted like “000000123.devlog”.
Sourcepub fn next(&self) -> Result<LogPath, Error>
pub fn next(&self) -> Result<LogPath, Error>
Returns the path for the next entry in the sequence.
In the unlikely event that the maximum sequence number is reached,
returns Error::LogFileLimitExceeded
.
Trait Implementations§
Source§impl Ord for LogPath
Order by sequence number.
impl Ord for LogPath
Order by sequence number.
Source§impl PartialOrd for LogPath
Order by sequence number.
impl PartialOrd for LogPath
Order by sequence number.
impl Eq for LogPath
Auto Trait Implementations§
impl Freeze for LogPath
impl RefUnwindSafe for LogPath
impl Send for LogPath
impl Sync for LogPath
impl Unpin for LogPath
impl UnwindSafe for LogPath
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