Enum self_encryption::DataMap [−][src]
pub enum DataMap { Chunks(Vec<ChunkDetails>), Content(Vec<u8>), None, }
Holds the information that is required to recover the content of the encrypted file. Depending
on the file size, this is held as a vector of ChunkDetails
, or as raw data.
Variants
Chunks(Vec<ChunkDetails>)
If the file is large enough (larger than 3072 bytes, 3 * MIN_CHUNK_SIZE), this algorithm holds the list of the file’s chunks and corresponding hashes.
Very small files (less than 3072 bytes, 3 * MIN_CHUNK_SIZE) are not split into chunks and are put in here in their entirety.
empty datamap
Implementations
impl DataMap
[src]
impl DataMap
[src]pub fn len(&self) -> usize
[src]
Original (pre-encryption) size of file in DataMap.
pub fn get_chunks(&self) -> Vec<ChunkDetails>
[src]
Returns the list of chunks pre and post encryption hashes if present.
pub fn get_sorted_chunks(&self) -> Vec<ChunkDetails>
[src]
The algorithm requires this to be a sorted list to allow get_pad_iv_key to obtain the correct pre-encryption hashes for decryption/encryption.
pub fn has_chunks(&self) -> bool
[src]
Whether the content is stored as chunks or as raw data.
pub fn chunks_sort(chunks: &mut [ChunkDetails])
[src]
Sorts list of chunks using quicksort
Trait Implementations
impl<'de> Deserialize<'de> for DataMap
[src]
impl<'de> Deserialize<'de> for DataMap
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialOrd<DataMap> for DataMap
[src]
impl PartialOrd<DataMap> for DataMap
[src]impl StructuralEq for DataMap
[src]
impl StructuralEq for DataMap
[src]impl StructuralPartialEq for DataMap
[src]
impl StructuralPartialEq for DataMap
[src]Auto Trait Implementations
impl RefUnwindSafe for DataMap
impl RefUnwindSafe for DataMap
impl UnwindSafe for DataMap
impl UnwindSafe for DataMap
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,