pub enum Mode {
AsIs,
Verify,
Restore,
}
Available on crate feature
streaming-input
only.Expand description
Iteration Mode
Variants§
AsIs
Provide the trailer as read from the pack
Verify
Generate an own hash and trigger an error on the last iterated object if it does not match the hash provided with the pack.
This way the one iterating the data cannot miss corruption as long as the iteration is continued through to the end.
Restore
Generate an own hash and if there was an error or the objects are depleted early due to partial packs, return the last valid entry and with our own hash thus far. Note that the existing pack hash, if present, will be ignored. As we won’t know which objects fails, every object will have the hash obtained thus far. This also means that algorithms must know about this possibility, or else might wrongfully assume the pack is finished.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mode
impl<'de> Deserialize<'de> for Mode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Mode
impl Ord for Mode
Source§impl PartialOrd for Mode
impl PartialOrd for Mode
impl Copy for Mode
impl Eq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnwindSafe for Mode
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