Struct EncryptPayload
pub struct EncryptPayload<'a> {
pub msg: &'a [u8],
pub descriptor: &'a str,
pub context: Cow<'a, [Context]>,
pub decryption_policy: Option<DecryptionPolicy>,
}Fields§
§msg: &'a [u8]§descriptor: &'a str§context: Cow<'a, [Context]>§decryption_policy: Option<DecryptionPolicy>Implementations§
§impl<'a> EncryptPayload<'a>
impl<'a> EncryptPayload<'a>
pub fn new(msg: &'a [u8]) -> Self
pub fn new(msg: &'a [u8]) -> Self
Create a new EncryptPayload with the given message.
pub fn set_context(self, context: Cow<'a, [Context]>) -> Self
pub fn set_context(self, context: Cow<'a, [Context]>) -> Self
Set the Context for the EncryptPayload.
This will replace any existing contexts.
pub fn set_decryption_policy(self, policy: DecryptionPolicy) -> Self
pub fn set_decryption_policy(self, policy: DecryptionPolicy) -> Self
Set a DecryptionPolicy for OR-style lock context.
When set, tag_version=1 is used.
pub fn new_with_descriptor(msg: &'a [u8], descriptor: &'a str) -> Self
pub fn new_with_descriptor(msg: &'a [u8], descriptor: &'a str) -> Self
Create a new EncryptPayload with the given message and descriptor.
The descriptor is used as the additional authenticated data (AAD) for the encryption.
Trait Implementations§
§impl<'a> Clone for EncryptPayload<'a>
impl<'a> Clone for EncryptPayload<'a>
§fn clone(&self) -> EncryptPayload<'a>
fn clone(&self) -> EncryptPayload<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> Debug for EncryptPayload<'a>
impl<'a> Debug for EncryptPayload<'a>
§impl<'a> From<&'a BytesWithDescriptor> for EncryptPayload<'a>
impl<'a> From<&'a BytesWithDescriptor> for EncryptPayload<'a>
§fn from(_: &'a BytesWithDescriptor) -> Self
fn from(_: &'a BytesWithDescriptor) -> Self
Converts to this type from the input type.
§impl<'a> From<&'a EncryptPayload<'a>> for GenerateKeyPayload<'a>
impl<'a> From<&'a EncryptPayload<'a>> for GenerateKeyPayload<'a>
§fn from(payload: &'a EncryptPayload<'a>) -> Self
fn from(payload: &'a EncryptPayload<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for EncryptPayload<'a>
impl<'a> RefUnwindSafe for EncryptPayload<'a>
impl<'a> Send for EncryptPayload<'a>
impl<'a> Sync for EncryptPayload<'a>
impl<'a> Unpin for EncryptPayload<'a>
impl<'a> UnsafeUnpin for EncryptPayload<'a>
impl<'a> UnwindSafe for EncryptPayload<'a>
Blanket Implementations§
impl<T> AuthStrategyBounds for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more