pub struct EncryptedConfig { /* private fields */ }Available on crate feature
encryption only.Expand description
Authenticated encryption applied after serialization and optional compression.
Implementations§
Source§impl EncryptedConfig
impl EncryptedConfig
Sourcepub const fn with_plaintext_limit(self, limit: u64) -> Self
pub const fn with_plaintext_limit(self, limit: u64) -> Self
Overrides the maximum authenticated plaintext frame size.
Sourcepub fn serialize<T: Serialize + ?Sized>(&self, value: &T) -> Result<Vec<u8>>
pub fn serialize<T: Serialize + ?Sized>(&self, value: &T) -> Result<Vec<u8>>
Serializes and encrypts a value with a fresh random 192-bit nonce.
Sourcepub fn deserialize<T: DeserializeOwned>(&self, input: &[u8]) -> Result<T>
pub fn deserialize<T: DeserializeOwned>(&self, input: &[u8]) -> Result<T>
Decrypts, authenticates, and deserializes a complete frame.
Sourcepub fn deserialize_from<R: Read, T: DeserializeOwned>(
&self,
reader: R,
) -> Result<T>
pub fn deserialize_from<R: Read, T: DeserializeOwned>( &self, reader: R, ) -> Result<T>
Reads exactly one encrypted frame and leaves subsequent frames unread.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EncryptedConfig
impl RefUnwindSafe for EncryptedConfig
impl Send for EncryptedConfig
impl Sync for EncryptedConfig
impl Unpin for EncryptedConfig
impl UnsafeUnpin for EncryptedConfig
impl UnwindSafe for EncryptedConfig
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