[][src]Struct devlog::path::LogPath

pub struct LogPath { /* fields omitted */ }

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 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]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialOrd<LogPath> for LogPath[src]

Order by sequence number.

#[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 PartialEq<LogPath> for LogPath[src]

Equal if and only if the sequence numbers are equal.

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Eq for LogPath[src]

impl Debug for LogPath[src]

Auto Trait Implementations

impl Send for LogPath

impl Unpin for LogPath

impl Sync for LogPath

impl UnwindSafe for LogPath

impl RefUnwindSafe for LogPath

Blanket Implementations

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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