Struct encryption::encrypted_file::header::Header[][src]

pub struct Header {
    version: Version,
    crc32: u32,
    size: u64,
}

Header of encrypted file.

 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |     |       |              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ^   ^      ^         ^           ^
 |   |      |         |           | Serialized content (variable size)
 |   |      |         | Content size (8 bytes)
 |   |      | Crc32  (4 bytes)
 |   | Reserved  (3 bytes)
 | Version (1 bytes)

Fields

version: Versioncrc32: u32size: u64

Implementations

impl Header[src]

const SIZE: usize[src]

pub fn new(content: &[u8], version: Version) -> Header[src]

pub fn parse(buf: &[u8]) -> Result<(Header, &[u8], &[u8])>[src]

Parse bytes into header, content and remained bytes.

pub fn to_bytes(&self) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub fn version(&self) -> Version[src]

Trait Implementations

impl Clone for Header[src]

impl Debug for Header[src]

impl Eq for Header[src]

impl PartialEq<Header> for Header[src]

impl StructuralEq for Header[src]

impl StructuralPartialEq for Header[src]

Auto Trait Implementations

impl RefUnwindSafe for Header

impl Send for Header

impl Sync for Header

impl Unpin for Header

impl UnwindSafe for Header

Blanket Implementations

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

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

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

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

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

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

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[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 = Infallible

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]