#[repr(u8)]pub enum ContentType {
Text = 0,
Password = 1,
Secret = 2,
AfterlifeMessage = 3,
Template = 4,
Attachment = 5,
}Expand description
The type of content in the encrypted message.
#[repr(u8)] with explicit discriminants so the wire-format byte value is
stable and independent of declaration order. The From<ContentType> for u8
implementation below repeats those discriminants explicitly so the wire
mapping stays obvious without relying on a numeric cast.
Variants§
Text = 0
General text message.
Password = 1
Password or credential.
Secret = 2
Generic secret (API keys, 2FA seeds, etc.).
AfterlifeMessage = 3
Message to be delivered after sender’s death.
Template = 4
Pre-populated template message.
Attachment = 5
Binary attachment (file).
Trait Implementations§
Source§impl Clone for ContentType
impl Clone for ContentType
Source§fn clone(&self) -> ContentType
fn clone(&self) -> ContentType
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 moreimpl Copy for ContentType
Source§impl Debug for ContentType
impl Debug for ContentType
Source§impl<'de> Deserialize<'de> for ContentType
impl<'de> Deserialize<'de> for ContentType
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
impl Eq for ContentType
Source§impl From<ContentType> for u8
impl From<ContentType> for u8
Source§fn from(ct: ContentType) -> Self
fn from(ct: ContentType) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ContentType
impl PartialEq for ContentType
Source§fn eq(&self, other: &ContentType) -> bool
fn eq(&self, other: &ContentType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContentType
impl Serialize for ContentType
impl StructuralPartialEq for ContentType
Auto Trait Implementations§
impl Freeze for ContentType
impl RefUnwindSafe for ContentType
impl Send for ContentType
impl Sync for ContentType
impl Unpin for ContentType
impl UnsafeUnpin for ContentType
impl UnwindSafe for ContentType
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