pub struct LogManager {
pub entries: Vec<UnifiedEntry>,
/* private fields */
}Fields§
§entries: Vec<UnifiedEntry>Implementations§
Source§impl LogManager
impl LogManager
Sourcepub fn new(path: &str, rotation_limit: usize) -> Result<Self>
pub fn new(path: &str, rotation_limit: usize) -> Result<Self>
Create a new log manager with a rotation limit.
Sourcepub fn append(&mut self, entry: UnifiedEntry) -> Result<()>
pub fn append(&mut self, entry: UnifiedEntry) -> Result<()>
Append a new entry.
Sourcepub fn stream_log(path: &str) -> Result<impl Iterator<Item = Result<String>>>
pub fn stream_log(path: &str) -> Result<impl Iterator<Item = Result<String>>>
Load entries from file (basic replay).
Sourcepub fn replay(&self) -> &[UnifiedEntry]
pub fn replay(&self) -> &[UnifiedEntry]
Replay all entries.
Sourcepub fn persist_to_file(&self, path: &str) -> Result<()>
pub fn persist_to_file(&self, path: &str) -> Result<()>
Persist entries to file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogManager
impl RefUnwindSafe for LogManager
impl Send for LogManager
impl Sync for LogManager
impl Unpin for LogManager
impl UnsafeUnpin for LogManager
impl UnwindSafe for LogManager
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