Enum distant_net::common::EncryptionType
source · pub enum EncryptionType {
XChaCha20Poly1305,
Unknown,
}Expand description
Represents the type of encryption for a EncryptionCodec
Variants
XChaCha20Poly1305
ChaCha20Poly1305 variant with an extended 192-bit (24-byte) nonce
Unknown
Indicates an unknown encryption type for use in handshakes
Implementations
sourceimpl EncryptionType
impl EncryptionType
sourcepub fn generate_secret_key_bytes(&self) -> Result<Vec<u8>>
pub fn generate_secret_key_bytes(&self) -> Result<Vec<u8>>
Generates bytes for a secret key based on the encryption type
sourcepub const fn known_variants() -> &'static [EncryptionType]
pub const fn known_variants() -> &'static [EncryptionType]
Returns a list of all variants of the type except unknown.
sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if type is unknown
sourcepub fn new_codec(&self, key: &[u8]) -> Result<EncryptionCodec>
pub fn new_codec(&self, key: &[u8]) -> Result<EncryptionCodec>
Creates a new EncryptionCodec for this type, failing if this type is unknown or the key
is an invalid length
Trait Implementations
sourceimpl Clone for EncryptionType
impl Clone for EncryptionType
sourcefn clone(&self) -> EncryptionType
fn clone(&self) -> EncryptionType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for EncryptionType
impl Debug for EncryptionType
sourceimpl<'de> Deserialize<'de> for EncryptionType
impl<'de> Deserialize<'de> for EncryptionType
sourcefn 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
sourceimpl Display for EncryptionType
impl Display for EncryptionType
sourceimpl Hash for EncryptionType
impl Hash for EncryptionType
sourceimpl PartialEq<EncryptionType> for EncryptionType
impl PartialEq<EncryptionType> for EncryptionType
sourcefn eq(&self, other: &EncryptionType) -> bool
fn eq(&self, other: &EncryptionType) -> bool
sourceimpl Serialize for EncryptionType
impl Serialize for EncryptionType
impl Copy for EncryptionType
impl Eq for EncryptionType
impl StructuralEq for EncryptionType
impl StructuralPartialEq for EncryptionType
Auto Trait Implementations
impl RefUnwindSafe for EncryptionType
impl Send for EncryptionType
impl Sync for EncryptionType
impl Unpin for EncryptionType
impl UnwindSafe for EncryptionType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more