[−][src]Struct devlog::path::LogPath
Methods
impl LogPath[src]
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.
pub fn new(dir: &Path, seq_num: usize) -> LogPath[src]
Create a new path with the specified sequence number, which must be at least one
and at most MAX_SEQ_NUM.
pub fn from_path(path: PathBuf) -> Option<LogPath>[src]
Parse the sequence number from a filesystem path.
Returns None if the filename isn't formatted like "000000123.devlog".
pub fn next(&self) -> Result<LogPath, Error>[src]
Returns the path for the next entry in the sequence.
In the unlikely event that the maximum sequence number is reached,
returns Error::LogFileLimitExceeded.
pub fn seq_num(&self) -> usize[src]
Returns the sequence number (e.g. "00000123.devlog" would have sequence number 123)
pub fn path(&self) -> &Path[src]
Returns the filesystem path.
Trait Implementations
impl Ord for LogPath[src]
Order by sequence number.
fn cmp(&self, other: &Self) -> Ordering[src]
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self[src]
clamp)Restrict a value to a certain interval. Read more
impl PartialOrd<LogPath> for LogPath[src]
Order by sequence number.
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Eq for LogPath[src]
impl PartialEq<LogPath> for LogPath[src]
Equal if and only if the sequence numbers are equal.
fn eq(&self, other: &Self) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl Debug for LogPath[src]
Auto Trait Implementations
impl Unpin for LogPath
impl Sync for LogPath
impl Send for LogPath
impl UnwindSafe for LogPath
impl RefUnwindSafe for LogPath
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
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,