pub struct Header { /* private fields */ }Expand description
File header, identifier and version information
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(
id: Uuid,
name: String,
cipher: Cipher,
kdf: KeyDerivation,
flags: VaultFlags,
) -> Header
pub fn new( id: Uuid, name: String, cipher: Cipher, kdf: KeyDerivation, flags: VaultFlags, ) -> Header
Create a new header.
Sourcepub fn flags(&self) -> &VaultFlags
pub fn flags(&self) -> &VaultFlags
Reference to the vault flags.
Sourcepub fn flags_mut(&mut self) -> &mut VaultFlags
pub fn flags_mut(&mut self) -> &mut VaultFlags
Mutable reference to the vault flags.
Sourcepub async fn read_content_offset<P>(path: P) -> Result<u64, Error>
pub async fn read_content_offset<P>(path: P) -> Result<u64, Error>
Read the content offset for a vault file verifying the identity bytes first.
Sourcepub async fn read_content_offset_slice(buffer: &[u8]) -> Result<u64, Error>
pub async fn read_content_offset_slice(buffer: &[u8]) -> Result<u64, Error>
Read the content offset for a vault slice verifying the identity bytes first.
Sourcepub async fn read_content_offset_stream<R>(stream: R) -> Result<u64, Error>
pub async fn read_content_offset_stream<R>(stream: R) -> Result<u64, Error>
Read the content offset for a stream verifying the identity bytes first.
Sourcepub async fn read_summary_file<P>(file: P) -> Result<Summary, Error>
pub async fn read_summary_file<P>(file: P) -> Result<Summary, Error>
Read the summary for a vault from a file.
Trait Implementations§
Source§impl Decodable for Header
impl Decodable for Header
Source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Header, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Header, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encodable for Header
impl Encodable for Header
Source§fn encode<'life0, 'life1, 'async_trait, W>(
&'life0 self,
writer: &'life1 mut BinaryWriter<W>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
Header: 'async_trait,
fn encode<'life0, 'life1, 'async_trait, W>(
&'life0 self,
writer: &'life1 mut BinaryWriter<W>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
Header: 'async_trait,
Encode self into the binary writer.
Source§impl Serialize for Header
impl Serialize for Header
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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