pub struct Header { /* private fields */ }Expand description
File header, identifier and version information
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(
id: VaultId,
name: String,
cipher: Cipher,
kdf: KeyDerivation,
flags: VaultFlags,
) -> Self
pub fn new( id: VaultId, name: String, cipher: Cipher, kdf: KeyDerivation, flags: VaultFlags, ) -> Self
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.
Set shared access permissions.
Sourcepub async fn read_content_offset<P: AsRef<Path>>(path: P) -> Result<u64, Error>
pub async fn read_content_offset<P: AsRef<Path>>(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: AsyncReadExt + AsyncSeek + Unpin + Send>(
stream: R,
) -> Result<u64, Error>
pub async fn read_content_offset_stream<R: AsyncReadExt + AsyncSeek + Unpin + Send>( stream: R, ) -> Result<u64, Error>
Read the content offset for a stream verifying the identity bytes first.
Sourcepub async fn read_summary_file<P: AsRef<Path>>(
file: P,
) -> Result<Summary, Error>
pub async fn read_summary_file<P: AsRef<Path>>( 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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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<()>> + Send + 'async_trait>>where
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encode<'life0, 'life1, 'async_trait, W>(
&'life0 self,
writer: &'life1 mut BinaryWriter<W>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Encode self into the binary writer.
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.