pub struct ChunkDeduplicationMap { /* private fields */ }Expand description
The ChunkDeduplicationMap stores the chunk size of the appropriate chunk.
Trait Implementations§
Source§impl ChunkMap for ChunkDeduplicationMap
impl ChunkMap for ChunkDeduplicationMap
Source§fn new(object_number: u64, chunkmap: BTreeMap<u64, Self::Value>) -> Self
fn new(object_number: u64, chunkmap: BTreeMap<u64, Self::Value>) -> Self
returns a new ChunkDeduplicationMap with the given values.
Source§fn new_empty(object_number: u64) -> Self
fn new_empty(object_number: u64) -> Self
returns a new, empty ChunkDeduplicationMap with the given values.
Source§fn flush(&mut self) -> BTreeMap<u64, Self::Value>
fn flush(&mut self) -> BTreeMap<u64, Self::Value>
Returns the inner map and replaces it with an empty map.
Source§fn current_size(&self) -> usize
fn current_size(&self) -> usize
The encoded size of this map.
Source§fn object_number(&self) -> u64
fn object_number(&self) -> u64
Returns the corresponding object number of the inner map
Source§fn set_target_size(&mut self, target_size: usize)
fn set_target_size(&mut self, target_size: usize)
Reset the target size to the given value.
Source§fn set_object_number(&mut self, object_number: u64)
fn set_object_number(&mut self, object_number: u64)
Sets the appropriate object number
Source§fn add_chunk_entry(&mut self, chunk_no: u64, value: Self::Value) -> bool
fn add_chunk_entry(&mut self, chunk_no: u64, value: Self::Value) -> bool
Tries to add a chunk entry.
Returns true, if the chunk no / value pair was added to the map.
Returns false, if the map is full (in this case, the pair was not added to the map).
Returns true, if the chunk no / value pair was added to the map.
Returns false, if the map is full (in this case, the pair was not added to the map).
Source§fn decrypt_and_decode<K, A, D>(
key: K,
encryption_algorithm: A,
data: &mut D,
chunk_no: u64,
) -> Result<Self>
fn decrypt_and_decode<K, A, D>( key: K, encryption_algorithm: A, data: &mut D, chunk_no: u64, ) -> Result<Self>
Decrypts and decodes the chunk map by using the given key.
Source§fn encrypt_encoded_map<K, A>(
&self,
key: K,
encryption_algorithm: A,
chunk_no: u64,
) -> Result<Vec<u8>>
fn encrypt_encoded_map<K, A>( &self, key: K, encryption_algorithm: A, chunk_no: u64, ) -> Result<Vec<u8>>
Encrypts the inner encoded map
Source§fn inner_structure_data<D: Read>(
data: &mut D,
) -> Result<ChunkMapInnerStructureData>where
Self: HeaderCoding,
fn inner_structure_data<D: Read>(
data: &mut D,
) -> Result<ChunkMapInnerStructureData>where
Self: HeaderCoding,
Returns the apprpropriate (encrypted) structure data
Source§fn decrypt_and_decode_at<K, A, D>(
key: K,
encryption_algorithm: A,
data: &D,
chunk_no: u64,
offset: u64,
) -> Result<Self>where
K: AsRef<[u8]>,
A: Borrow<EncryptionAlgorithm>,
D: ReadAt + ?Sized,
Self: Sized + HeaderCoding,
fn decrypt_and_decode_at<K, A, D>(
key: K,
encryption_algorithm: A,
data: &D,
chunk_no: u64,
offset: u64,
) -> Result<Self>where
K: AsRef<[u8]>,
A: Borrow<EncryptionAlgorithm>,
D: ReadAt + ?Sized,
Self: Sized + HeaderCoding,
Decrypts and decodes the chunk map by using the given key from given offset.
Source§impl Clone for ChunkDeduplicationMap
impl Clone for ChunkDeduplicationMap
Source§impl Debug for ChunkDeduplicationMap
impl Debug for ChunkDeduplicationMap
Source§impl Default for ChunkDeduplicationMap
impl Default for ChunkDeduplicationMap
Source§impl Display for ChunkDeduplicationMap
impl Display for ChunkDeduplicationMap
Source§impl Encryption for ChunkDeduplicationMap
impl Encryption for ChunkDeduplicationMap
Source§fn crypto_nonce_padding() -> u8
fn crypto_nonce_padding() -> u8
The appropriate, type specific padding value for the nonce (see official zff documentation).
Source§fn encrypt<K, M, A>(
key: K,
message: M,
nonce_value: u64,
algorithm: A,
) -> Result<Vec<u8>>
fn encrypt<K, M, A>( key: K, message: M, nonce_value: u64, algorithm: A, ) -> Result<Vec<u8>>
Encrypts the message, using the type specific nonce padding.
impl Eq for ChunkDeduplicationMap
Source§impl HeaderCoding for ChunkDeduplicationMap
impl HeaderCoding for ChunkDeduplicationMap
Source§type Item = ChunkDeduplicationMap
type Item = ChunkDeduplicationMap
the return value for decode_content(), decode_directly(), decode_for_key();
Source§fn identifier() -> u32
fn identifier() -> u32
returns the identifier (=Magic bytes) of the header.
Source§fn version() -> u8
fn version() -> u8
returns the version of the header.
This reflects the default version of the appropriate header used in zff v3.
Source§fn encode_content(&self) -> Vec<u8> ⓘ
fn encode_content(&self) -> Vec<u8> ⓘ
encodes the (potentially encryptable) content of the struct.
Source§fn encode_fixed_fields(&self) -> Vec<u8> ⓘ
fn encode_fixed_fields(&self) -> Vec<u8> ⓘ
encodes the (non-encryptable) content of the struct.
Source§fn decode_content(data: &[u8]) -> Result<Self>
fn decode_content(data: &[u8]) -> Result<Self>
decodes the content of the header.
Source§fn header_size(&self) -> usize
fn header_size(&self) -> usize
returns the size of the encoded header (in bytes)
Source§fn encode_directly(&self) -> Vec<u8> ⓘ
fn encode_directly(&self) -> Vec<u8> ⓘ
encodes the (header) value/object directly (= without key).
Source§fn decode_header_length<R: Read>(data: &mut R) -> Result<u64>
fn decode_header_length<R: Read>(data: &mut R) -> Result<u64>
decodes the length of the header.
Source§fn check_identifier<R: Read>(data: &mut R) -> bool
fn check_identifier<R: Read>(data: &mut R) -> bool
checks if the read identifier is valid for this header.
Source§fn check_version<R: Read>(data: &mut R) -> Result<()>
fn check_version<R: Read>(data: &mut R) -> Result<()>
checks if the read header / footer version is supported by this crate (only zff v3 headers / footers are supported).
Source§fn decode_at<R: ReadAt + ?Sized>(data: &R, offset: u64) -> Result<Self::Item>
fn decode_at<R: ReadAt + ?Sized>(data: &R, offset: u64) -> Result<Self::Item>
decodes the header at given offset.
Source§fn struct_name() -> &'static str
fn struct_name() -> &'static str
Method to show the “name” of the appropriate struct (e.g. to use this with fmt::Display).
This method is a helper method for fmt::Display and serde::ser::SerializeStruct (and for some debugging purposes).
Source§impl PartialEq for ChunkDeduplicationMap
impl PartialEq for ChunkDeduplicationMap
impl StructuralPartialEq for ChunkDeduplicationMap
Auto Trait Implementations§
impl Freeze for ChunkDeduplicationMap
impl RefUnwindSafe for ChunkDeduplicationMap
impl Send for ChunkDeduplicationMap
impl Sync for ChunkDeduplicationMap
impl Unpin for ChunkDeduplicationMap
impl UnsafeUnpin for ChunkDeduplicationMap
impl UnwindSafe for ChunkDeduplicationMap
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more