pub struct AofReader { /* private fields */ }Expand description
Reader for iterating over AOF records.
Implementations§
Source§impl AofReader
impl AofReader
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, FormatError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, FormatError>
Opens an AOF file and validates the header.
Sourcepub fn read_record(&mut self) -> Result<Option<AofRecord>, FormatError>
pub fn read_record(&mut self) -> Result<Option<AofRecord>, FormatError>
Reads the next record from the AOF.
Returns Ok(None) at end-of-file. On a truncated record (the
server crashed mid-write), returns Ok(None) rather than an error
— this is the expected recovery behavior.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AofReader
impl RefUnwindSafe for AofReader
impl Send for AofReader
impl Sync for AofReader
impl Unpin for AofReader
impl UnsafeUnpin for AofReader
impl UnwindSafe for AofReader
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