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 PartialEq for Mode
impl PartialEq for Mode
source§impl PartialOrd for Mode
impl PartialOrd for Mode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Mode
impl Eq for Mode
impl StructuralEq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more