pub struct NippyJarChecker<H: NippyJarHeader = ()> { /* private fields */ }Expand description
Performs consistency checks or heals on the NippyJar file
- Is the offsets file size expected?
- Is the data file size expected?
This is based on the assumption that NippyJar configuration is always the last one
to be updated when something is written, as by the NippyJarWriter::commit() function shows.
For checks (read-only) use check_consistency method.
For heals (read-write) use ensure_consistency method.
Implementations§
Source§impl<H: NippyJarHeader> NippyJarChecker<H>
impl<H: NippyJarHeader> NippyJarChecker<H>
Sourcepub const fn new(jar: NippyJar<H>) -> Self
pub const fn new(jar: NippyJar<H>) -> Self
Creates a new instance of NippyJarChecker with the provided NippyJar.
This method initializes the checker without any associated file handles for
the data or offsets files. The NippyJar passed in contains all necessary
configurations for handling data.
Sourcepub fn check_consistency(&mut self) -> Result<(), NippyJarError>
pub fn check_consistency(&mut self) -> Result<(), NippyJarError>
It will throw an error if the NippyJar is in a inconsistent state.
Sourcepub fn ensure_consistency(&mut self) -> Result<(), NippyJarError>
pub fn ensure_consistency(&mut self) -> Result<(), NippyJarError>
It will attempt to heal if the NippyJar is in a inconsistent state.
ATTENTION: disk commit should be handled externally by consuming Self
Trait Implementations§
Auto Trait Implementations§
impl<H> Freeze for NippyJarChecker<H>where
H: Freeze,
impl<H> RefUnwindSafe for NippyJarChecker<H>where
H: RefUnwindSafe,
impl<H> Send for NippyJarChecker<H>
impl<H> Sync for NippyJarChecker<H>
impl<H> Unpin for NippyJarChecker<H>where
H: Unpin,
impl<H> UnwindSafe for NippyJarChecker<H>where
H: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.