Skip to main content

PayloadCodec

Trait PayloadCodec 

Source
pub trait PayloadCodec: Send + Sync {
    // Required method
    fn encode(
        &self,
        plaintext: &[u8],
    ) -> Result<EncryptedPayload, EncryptionError>;
}

Required Methods§

Source

fn encode(&self, plaintext: &[u8]) -> Result<EncryptedPayload, EncryptionError>

Encode serialized page JSON for a trusted client or intermediary.

§Errors

Returns an error if the payload cannot be encoded.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§