[−][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 Debug for LogPath
[src]
impl Eq for LogPath
[src]
impl Ord for LogPath
[src]
Order by sequence number.
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
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.
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,