Struct carapax::types::PrivateChat
source · pub struct PrivateChat {
pub id: ChatPeerId,
pub first_name: String,
pub last_name: Option<String>,
pub username: Option<ChatUsername>,
}
Expand description
Represents a private chat.
Fields§
§id: ChatPeerId
Unique identifier of the chat.
first_name: String
First name of the other party.
last_name: Option<String>
Last name of the other party.
username: Option<ChatUsername>
Username of the target chat.
Implementations§
source§impl PrivateChat
impl PrivateChat
sourcepub fn new<A, B>(id: A, first_name: B) -> PrivateChat
pub fn new<A, B>(id: A, first_name: B) -> PrivateChat
Creates a new PrivateChat
.
§Arguments
id
- Unique identifier of the target chat.first_name
- First name of the other party.
sourcepub fn with_last_name<T>(self, value: T) -> PrivateChat
pub fn with_last_name<T>(self, value: T) -> PrivateChat
sourcepub fn with_username<T>(self, value: T) -> PrivateChatwhere
T: Into<ChatUsername>,
pub fn with_username<T>(self, value: T) -> PrivateChatwhere
T: Into<ChatUsername>,
Trait Implementations§
source§impl Clone for PrivateChat
impl Clone for PrivateChat
source§fn clone(&self) -> PrivateChat
fn clone(&self) -> PrivateChat
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 PrivateChat
impl Debug for PrivateChat
source§impl<'de> Deserialize<'de> for PrivateChat
impl<'de> Deserialize<'de> for PrivateChat
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<PrivateChat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<PrivateChat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<PrivateChat> for Chat
impl From<PrivateChat> for Chat
source§fn from(original: PrivateChat) -> Chat
fn from(original: PrivateChat) -> Chat
Converts to this type from the input type.
source§impl PartialEq for PrivateChat
impl PartialEq for PrivateChat
source§fn eq(&self, other: &PrivateChat) -> bool
fn eq(&self, other: &PrivateChat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PrivateChat
impl Serialize for PrivateChat
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PrivateChat
Auto Trait Implementations§
impl Freeze for PrivateChat
impl RefUnwindSafe for PrivateChat
impl Send for PrivateChat
impl Sync for PrivateChat
impl Unpin for PrivateChat
impl UnwindSafe for PrivateChat
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>
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