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

impl Eq for LogPath[src]

impl Ord for LogPath[src]

Order by sequence number.

impl PartialEq<LogPath> for LogPath[src]

Equal if and only if the sequence numbers are equal.

impl PartialOrd<LogPath> for LogPath[src]

Order by sequence number.

impl StructuralEq for LogPath[src]

Auto Trait Implementations

impl RefUnwindSafe for LogPath

impl Send for LogPath

impl Sync for LogPath

impl Unpin for LogPath

impl UnwindSafe for LogPath

Blanket Implementations

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,