[][src]Enum self_encryption::DataMap

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.

Content(Vec<u8>)

Very small files (less than 3072 bytes, 3 * MIN_CHUNK_SIZE) are not split into chunks and are put in here in their entirety.

None

empty datamap

Methods

impl DataMap[src]

pub fn len(&self) -> u64[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 Clone for DataMap[src]

impl Eq for DataMap[src]

impl Ord for DataMap[src]

impl PartialEq<DataMap> for DataMap[src]

impl PartialOrd<DataMap> for DataMap[src]

impl Debug for DataMap[src]

impl StructuralPartialEq for DataMap[src]

impl StructuralEq for DataMap[src]

impl Serialize for DataMap[src]

impl<'de> Deserialize<'de> for DataMap[src]

Auto Trait Implementations

impl Send for DataMap

impl Sync for DataMap

impl Unpin for DataMap

impl UnwindSafe for DataMap

impl RefUnwindSafe for DataMap

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self