Skip to main content

EncryptedBlob

Trait EncryptedBlob 

Source
pub trait EncryptedBlob: Sized {
    // Required methods
    fn from_bytes(bytes: Vec<u8>) -> Self;
    fn as_bytes(&self) -> &[u8] ;
    fn into_bytes(self) -> Vec<u8> ;
}
Expand description

Common interface for typed encrypted blob newtypes.

Every blob type wraps Vec<u8> ciphertext and provides the same constructors/accessors. This trait enables generic operations (e.g., typed ObjectStore::put_blob / get_blob) without knowing the concrete blob type.

Required Methods§

Source

fn from_bytes(bytes: Vec<u8>) -> Self

Wrap raw ciphertext bytes.

Source

fn as_bytes(&self) -> &[u8]

Access the underlying ciphertext bytes.

Source

fn into_bytes(self) -> Vec<u8>

Consume and return the underlying ciphertext bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§