Struct libsignal_service::models::Contact
source · pub struct Contact {
pub uuid: Uuid,
pub phone_number: Option<PhoneNumber>,
pub name: String,
pub color: Option<String>,
pub verified: Verified,
pub profile_key: Vec<u8>,
pub expire_timer: u32,
pub expire_timer_version: u32,
pub inbox_position: u32,
pub archived: bool,
pub avatar: Option<Attachment<Bytes>>,
}
Expand description
Mirror of the protobuf ContactDetails message
but with stronger types (e.g. ServiceAddress
instead of optional uuid and string phone numbers)
and some helper functions
Fields§
§uuid: Uuid
§phone_number: Option<PhoneNumber>
§name: String
§color: Option<String>
§verified: Verified
§profile_key: Vec<u8>
§expire_timer: u32
§expire_timer_version: u32
§inbox_position: u32
§archived: bool
§avatar: Option<Attachment<Bytes>>
Implementations§
source§impl Contact
impl Contact
pub fn from_proto( contact_details: ContactDetails, avatar_data: Option<Bytes>, ) -> Result<Self, ParseContactError>
pub fn profile_key(&self) -> Result<ProfileKey, ParseContactError>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Contact
impl<'de> Deserialize<'de> for Contact
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
Auto Trait Implementations§
impl !Freeze for Contact
impl RefUnwindSafe for Contact
impl Send for Contact
impl Sync for Contact
impl Unpin for Contact
impl UnwindSafe for Contact
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more