Skip to main content

VirtualFileFooter

Struct VirtualFileFooter 

Source
pub struct VirtualFileFooter {
    pub filenumber: u64,
    pub hash_header: HashHeader,
    pub length_of_data: u64,
    pub vffc: VirtualFileFooterContent,
}
Expand description

Footer of a virtual logical file.

This footer stores the virtual file’s file number, hash metadata, logical data length, and the type-specific VirtualFileFooterContent.

Fields§

§filenumber: u64

The file number of the virtual file this footer belongs to.

§hash_header: HashHeader

The hash information for the virtual file data.

§length_of_data: u64

The logical length of the represented file data in bytes.

§vffc: VirtualFileFooterContent

The type-specific virtual file footer content.

Implementations§

Source§

impl VirtualFileFooter

Source

pub fn new( filenumber: u64, hash_header: HashHeader, length_of_data: u64, vffc: VirtualFileFooterContent, ) -> Self

Creates a new VirtualFileFooter from the file number, hash information, logical data length, and footer content.

decodes the encrypted header with the given key and crate::header::EncryptionHeader at given offset. The appropriate crate::header::EncryptionHeader has to be stored in the appropriate crate::header::ObjectHeader.

decodes the encrypted header with the given key and crate::header::EncryptionHeader. The appropriate crate::header::EncryptionHeader has to be stored in the appropriate crate::header::ObjectHeader.

Trait Implementations§

Source§

impl Clone for VirtualFileFooter

Source§

fn clone(&self) -> VirtualFileFooter

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VirtualFileFooter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Encryption for VirtualFileFooter

Source§

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>>
where K: AsRef<[u8]>, M: AsRef<[u8]>, A: Borrow<EncryptionAlgorithm>,

Encrypts the message, using the type specific nonce padding.
Source§

fn decrypt<K, M, A>( key: K, message: M, nonce_value: u64, algorithm: A, ) -> Result<Vec<u8>>
where K: AsRef<[u8]>, M: AsRef<[u8]>, A: Borrow<EncryptionAlgorithm>,

Decrypts the message, using the type specific nonce padding.
Source§

fn gen_crypto_nonce(nonce_value: u64) -> Result<Nonce<U12>>

Method to generate a 96-bit nonce for the appropriate message type (using the given value).
Source§

impl Eq for VirtualFileFooter

Source§

impl From<VirtualFileFooter> for VirtualFileFooterMetadata

Source§

fn from(vff: VirtualFileFooter) -> Self

Converts to this type from the input type.
Source§

impl HeaderCoding for VirtualFileFooter

Source§

type Item = VirtualFileFooter

the return value for decode_content(), decode_directly(), decode_for_key();
Source§

fn version() -> u8

returns the version of the header. This reflects the default version of the appropriate header used in zff v3.
Source§

fn identifier() -> u32

returns the identifier (=Magic bytes) of the header.
Source§

fn encode_content(&self) -> Vec<u8> ⓘ

encodes the (potentially encryptable) content of the struct.
Source§

fn encode_fixed_fields(&self) -> Vec<u8> ⓘ

encodes the (non-encryptable) content of the struct.
Source§

fn decode_content(data: &[u8]) -> Result<Self>

decodes the content of the header.
Source§

fn encode_header(&self) -> Vec<u8> ⓘ

encodes the header.
Source§

fn header_size(&self) -> usize

returns the size of the encoded header (in bytes)
Source§

fn encode_key<K: Into<String>>(key: K) -> Vec<u8> ⓘ

encodes a given key.
Source§

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>

decodes the length of the header.
Source§

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<()>

checks if the read header / footer version is supported by this crate (only zff v3 headers / footers are supported).
Source§

fn decode_directly<R: Read>(data: &mut R) -> Result<Self::Item>

decodes the header directly.
Source§

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

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 HeaderEncryption for VirtualFileFooter

Source§

fn nonce_value(&self) -> u64

The value which should be used to calculate the nonce (e.g. the filenumber for a FileHeader).
Source§

fn encryption_precondition(&self) -> bool

Optional precondition to check if encryption is possible. true if encryption is possible, false if precondition fails.
Source§

fn encrypt_directly<E: Borrow<EncryptionInformation>>( &self, encryption_information: E, ) -> Result<Vec<u8>>

encodes the header to a Vec<u8>. Read more
Source§

fn encode_encrypted_header<E: Borrow<EncryptionInformation>>( &self, encryption_information: E, ) -> Result<Vec<u8>>

encrypts and encodes the header.
Source§

fn encoded_fixed_fields_for_encryption(&self) -> Vec<u8> ⓘ

Sometimes, we have to set flag values…than, we have to modify the fixed fields.
Source§

impl PartialEq for VirtualFileFooter

Source§

fn eq(&self, other: &VirtualFileFooter) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VirtualFileFooter

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V