pub struct PayloadProtection { /* private fields */ }Expand description
A process-local keyring. A missing active key makes this configuration read-only.
Implementations§
Source§impl PayloadProtection
impl PayloadProtection
pub fn new( keys: impl IntoIterator<Item = (String, [u8; 32])>, active_key_id: Option<String>, ) -> Result<Self, ProtectionError>
Sourcepub fn allow_plaintext_reads(self) -> Self
pub fn allow_plaintext_reads(self) -> Self
Permit reads of historical plain Avro Value envelopes during migration.
Sourcepub fn protect(
&self,
value: &AvroValue,
context: ProtectionContext<'_>,
) -> Result<PayloadEnvelope, ProtectionError>
pub fn protect( &self, value: &AvroValue, context: ProtectionContext<'_>, ) -> Result<PayloadEnvelope, ProtectionError>
Protect once at admission. Retain the returned envelope across retries.
pub fn open( &self, envelope: &PayloadEnvelope, context: ProtectionContext<'_>, ) -> Result<AvroValue, ProtectionError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PayloadProtection
impl RefUnwindSafe for PayloadProtection
impl Send for PayloadProtection
impl Sync for PayloadProtection
impl Unpin for PayloadProtection
impl UnwindSafe for PayloadProtection
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