#[repr(u32)]pub enum Origin {
Show 20 variants
Unknown = 0,
MailinglistAddress = 2,
Hidden = 8,
IncomingUnknownFrom = 16,
IncomingUnknownCc = 32,
IncomingUnknownTo = 64,
UnhandledQrScan = 128,
UnhandledSecurejoinQrScan = 129,
IncomingReplyTo = 256,
IncomingCc = 512,
IncomingTo = 1_024,
CreateChat = 2_048,
OutgoingBcc = 4_096,
OutgoingCc = 8_192,
OutgoingTo = 16_384,
Internal = 262_144,
AddressBook = 524_288,
SecurejoinInvited = 16_777_216,
SecurejoinJoined = 33_554_432,
ManuallyCreated = 67_108_864,
}
Expand description
Possible origins of a contact.
Variants§
Unknown = 0
Unknown origin. Can be used as a minimum origin to specify that the caller does not care about origin of the contact.
MailinglistAddress = 2
The contact is a mailing list address, needed to unblock mailing lists
Hidden = 8
Hidden on purpose, e.g. addresses with the word “noreply” in it
IncomingUnknownFrom = 16
From: of incoming messages of unknown sender
IncomingUnknownCc = 32
Cc: of incoming messages of unknown sender
IncomingUnknownTo = 64
To: of incoming messages of unknown sender
UnhandledQrScan = 128
Address scanned but not verified.
UnhandledSecurejoinQrScan = 129
Address scanned from a SecureJoin QR code, but not verified yet.
IncomingReplyTo = 256
Reply-To: of incoming message of known sender Contacts with at least this origin value are shown in the contact list.
IncomingCc = 512
Cc: of incoming message of known sender
IncomingTo = 1_024
additional To:’s of incoming message of known sender
CreateChat = 2_048
a chat was manually created for this user, but no message yet sent
OutgoingBcc = 4_096
message sent by us
OutgoingCc = 8_192
message sent by us
OutgoingTo = 16_384
message sent by us
Internal = 262_144
internal use
AddressBook = 524_288
address is in our address book
SecurejoinInvited = 16_777_216
set on Alice’s side for contacts like Bob that have scanned the QR code offered by her. Only means the contact has once been established using the “securejoin” procedure in the past, getting the current key verification status requires calling contact_is_verified() !
SecurejoinJoined = 33_554_432
set on Bob’s side for contacts scanned and verified from a QR code. Only means the contact has once been established using the “securejoin” procedure in the past, getting the current key verification status requires calling contact_is_verified() !
ManuallyCreated = 67_108_864
contact added manually by create_contact(), this should be the largest origin as otherwise the user cannot modify the names
Implementations§
Trait Implementations§
source§impl FromPrimitive for Origin
impl FromPrimitive for Origin
source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§impl FromSql for Origin
impl FromSql for Origin
source§fn column_result(col: ValueRef<'_>) -> FromSqlResult<Self>
fn column_result(col: ValueRef<'_>) -> FromSqlResult<Self>
source§impl Ord for Origin
impl Ord for Origin
source§impl PartialOrd for Origin
impl PartialOrd for Origin
source§impl ToPrimitive for Origin
impl ToPrimitive for Origin
source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned.source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
self
to a u128
. If the value cannot be
represented by a u128
(u64
under the default implementation), then
None
is returned. Read moreimpl Copy for Origin
impl Eq for Origin
impl StructuralPartialEq for Origin
Auto Trait Implementations§
impl Freeze for Origin
impl RefUnwindSafe for Origin
impl Send for Origin
impl Sync for Origin
impl Unpin for Origin
impl UnwindSafe for Origin
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.