pub struct SnapshotReader {
pub shard_id: u16,
pub entry_count: u32,
/* private fields */
}Expand description
Reads entries from a snapshot file.
Fields§
§shard_id: u16§entry_count: u32Implementations§
Source§impl SnapshotReader
impl SnapshotReader
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, FormatError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, FormatError>
Opens a snapshot file and reads the header.
Sourcepub fn read_entry(&mut self) -> Result<Option<SnapEntry>, FormatError>
pub fn read_entry(&mut self) -> Result<Option<SnapEntry>, FormatError>
Reads the next entry. Returns None when all entries have been read.
Verifies the footer CRC32 after all entries have been read. Must be called after reading all entries.
Auto Trait Implementations§
impl Freeze for SnapshotReader
impl RefUnwindSafe for SnapshotReader
impl Send for SnapshotReader
impl Sync for SnapshotReader
impl Unpin for SnapshotReader
impl UnwindSafe for SnapshotReader
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