#[repr(u16)]pub enum EncryptionAlgo {
Ecb = 0,
Cbc = 1,
Other = 255,
}
Expand description
Supported encryption algorithms.
This enum defines the supported encryption algorithms, each represented by a specific
identifier (u16 value). The available algorithms include Ecb
(Electronic Codebook),
Cbc
(Cipher Block Chaining), and Other
for any unspecified or custom algorithms.
§Variants
Ecb
: Electronic Codebook mode encryption (0).Cbc
: Cipher Block Chaining mode encryption (1).Other
: Represents other custom or unsupported encryption algorithms (0xFF).
Variants§
Trait Implementations§
Source§impl Clone for EncryptionAlgo
impl Clone for EncryptionAlgo
Source§fn clone(&self) -> EncryptionAlgo
fn clone(&self) -> EncryptionAlgo
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EncryptionAlgo
impl Debug for EncryptionAlgo
Source§impl Default for EncryptionAlgo
impl Default for EncryptionAlgo
Source§fn default() -> EncryptionAlgo
fn default() -> EncryptionAlgo
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EncryptionAlgo
impl<'de> Deserialize<'de> for EncryptionAlgo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for EncryptionAlgo
impl Ord for EncryptionAlgo
Source§fn cmp(&self, other: &EncryptionAlgo) -> Ordering
fn cmp(&self, other: &EncryptionAlgo) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for EncryptionAlgo
impl PartialEq for EncryptionAlgo
Source§impl PartialOrd for EncryptionAlgo
impl PartialOrd for EncryptionAlgo
Source§impl Serialize for EncryptionAlgo
impl Serialize for EncryptionAlgo
Source§impl TryFrom<u16> for EncryptionAlgo
impl TryFrom<u16> for EncryptionAlgo
Source§fn try_from(value: u16) -> Result<Self, Self::Error>
fn try_from(value: u16) -> Result<Self, Self::Error>
Tries to convert a u16
value to an EncryptionAlgo
variant.
§Parameters
value
: Theu16
value representing the encryption algorithm.
§Returns
Ok(EncryptionAlgo)
: The correspondingEncryptionAlgo
variant if the value matches.Err(Error::InvalidEnumValue)
: An error if the value doesn’t match a valid encryption algorithm.
§Example
use amebazii::types::enums::EncryptionAlgo;
let algo = EncryptionAlgo::try_from(0).unwrap();
assert_eq!(algo, EncryptionAlgo::Ecb); // Successfully converts to Ecb.
impl Copy for EncryptionAlgo
impl Eq for EncryptionAlgo
impl StructuralPartialEq for EncryptionAlgo
Auto Trait Implementations§
impl Freeze for EncryptionAlgo
impl RefUnwindSafe for EncryptionAlgo
impl Send for EncryptionAlgo
impl Sync for EncryptionAlgo
impl Unpin for EncryptionAlgo
impl UnwindSafe for EncryptionAlgo
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