Skip to main content

SensitiveShape

Trait SensitiveShape 

Source
pub trait SensitiveShape: Sized {
    type Encrypted: Clone + Serialize + DeserializeOwned + SurrealValue;

    // Required methods
    fn encrypt_with_context(
        &self,
        context: &CryptoContext,
    ) -> Result<Self::Encrypted, CryptoError>;
    fn decrypt_with_context(
        encrypted: &Self::Encrypted,
        context: &CryptoContext,
    ) -> Result<Self, CryptoError>;
}
Expand description

Recursive runtime seam for supported #[secure] shapes.

Required Associated Types§

Source

type Encrypted: Clone + Serialize + DeserializeOwned + SurrealValue

Stored representation for this secure shape.

Required Methods§

Source

fn encrypt_with_context( &self, context: &CryptoContext, ) -> Result<Self::Encrypted, CryptoError>

Encrypts under an already-resolved effective secure-field context.

Source

fn decrypt_with_context( encrypted: &Self::Encrypted, context: &CryptoContext, ) -> Result<Self, CryptoError>

Decrypts under an already-resolved effective secure-field context.

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.

Implementations on Foreign Types§

Source§

impl SensitiveShape for String

Source§

impl<T> SensitiveShape for Option<T>
where T: SensitiveShape,

Source§

impl<T> SensitiveShape for Vec<T>
where T: SensitiveShape,

Implementors§