#[non_exhaustive]
pub enum Cipher {
None,
Aes256Ctr,
}Expand description
Cipher algorithms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
source§impl Cipher
impl Cipher
sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Get the string identifier which corresponds to this algorithm.
sourcepub fn key_and_iv_size(self) -> Option<(usize, usize)>
pub fn key_and_iv_size(self) -> Option<(usize, usize)>
Get the key and IV size for this cipher in bytes.
sourcepub fn block_size(self) -> usize
pub fn block_size(self) -> usize
Get the block size for this cipher in bytes.
sourcepub fn padding_len(self, input_size: usize) -> usize
pub fn padding_len(self, input_size: usize) -> usize
Compute the length of padding necessary to pad the given input to the block size.
Trait Implementations§
source§impl Ord for Cipher
impl Ord for Cipher
source§impl PartialEq<Cipher> for Cipher
impl PartialEq<Cipher> for Cipher
source§impl PartialOrd<Cipher> for Cipher
impl PartialOrd<Cipher> for Cipher
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for Cipher
impl Eq for Cipher
impl StructuralEq for Cipher
impl StructuralPartialEq for Cipher
Auto Trait Implementations§
impl RefUnwindSafe for Cipher
impl Send for Cipher
impl Sync for Cipher
impl Unpin for Cipher
impl UnwindSafe for Cipher
Blanket Implementations§
source§impl<T> Encode for Twhere
T: Label,
impl<T> Encode for Twhere
T: Label,
source§fn encoded_len(&self) -> Result<usize, <T as Label>::Error>
fn encoded_len(&self) -> Result<usize, <T as Label>::Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.
source§fn encode(&self, writer: &mut impl Writer) -> Result<(), <T as Label>::Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), <T as Label>::Error>
Encode this value using the provided
Writer.source§fn encoded_len_prefixed(&self) -> Result<usize, Self::Error>
fn encoded_len_prefixed(&self) -> Result<usize, Self::Error>
Return the length of this type after encoding when prepended with a
uint32 length prefix.source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Self::Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Self::Error>
Encode this value, first prepending a
uint32 length prefix
set to Encode::encoded_len.