pub enum UserIdentifier<'a> {
UserIdOrLocalpart(&'a str),
Email {
address: &'a str,
},
Msisdn {
number: &'a str,
},
PhoneNumber {
country: &'a str,
phone: &'a str,
},
// some variants omitted
}
Available on (crate features
client-api-c
or client-api-s
) and (crate features client
or server
) and crate feature api
only.Expand description
Identification information for the user.
Variants
UserIdOrLocalpart(&'a str)
Either a fully qualified Matrix user ID, or just the localpart (as part of the ‘identifier’ field).
Email
Fields
address: &'a str
The email address.
An email address.
Msisdn
A phone number in the MSISDN format.
PhoneNumber
Fields
country: &'a str
The country that the phone number is from.
This is a two-letter uppercase ISO-3166-1 alpha-2 country code.
phone: &'a str
The phone number.
A phone number as a separate country code and phone number.
The homeserver will be responsible for canonicalizing this to the MSISDN format.
Implementations
sourceimpl<'a> UserIdentifier<'a>
impl<'a> UserIdentifier<'a>
sourcepub fn third_party_id(medium: &'a Medium, address: &'a str) -> UserIdentifier<'a>
pub fn third_party_id(medium: &'a Medium, address: &'a str) -> UserIdentifier<'a>
Creates a new UserIdentifier
from the given third party identifier.
sourcepub fn as_third_party_id(&self) -> Option<(&'a Medium, &'a str)>
pub fn as_third_party_id(&self) -> Option<(&'a Medium, &'a str)>
Get this UserIdentifier
as a third party identifier if it is one.
Trait Implementations
sourceimpl<'a> Clone for UserIdentifier<'a>
impl<'a> Clone for UserIdentifier<'a>
sourcefn clone(&self) -> UserIdentifier<'a>
fn clone(&self) -> UserIdentifier<'a>
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<'a> Debug for UserIdentifier<'a>
impl<'a> Debug for UserIdentifier<'a>
sourceimpl<'a> From<&'a OwnedUserId> for UserIdentifier<'a>
impl<'a> From<&'a OwnedUserId> for UserIdentifier<'a>
sourcefn from(id: &'a OwnedUserId) -> UserIdentifier<'a>
fn from(id: &'a OwnedUserId) -> UserIdentifier<'a>
Converts to this type from the input type.
sourceimpl<'a> From<&'a UserId> for UserIdentifier<'a>
impl<'a> From<&'a UserId> for UserIdentifier<'a>
sourcefn from(id: &'a UserId) -> UserIdentifier<'a>
fn from(id: &'a UserId) -> UserIdentifier<'a>
Converts to this type from the input type.
sourceimpl<'a> PartialEq<UserIdentifier<'a>> for UserIdentifier<'a>
impl<'a> PartialEq<UserIdentifier<'a>> for UserIdentifier<'a>
sourcefn eq(&self, other: &UserIdentifier<'a>) -> bool
fn eq(&self, other: &UserIdentifier<'a>) -> bool
sourceimpl<'a> Serialize for UserIdentifier<'a>
impl<'a> Serialize for UserIdentifier<'a>
sourcefn 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<'a> Eq for UserIdentifier<'a>
impl<'a> StructuralEq for UserIdentifier<'a>
impl<'a> StructuralPartialEq for UserIdentifier<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for UserIdentifier<'a>
impl<'a> Send for UserIdentifier<'a>
impl<'a> Sync for UserIdentifier<'a>
impl<'a> Unpin for UserIdentifier<'a>
impl<'a> UnwindSafe for UserIdentifier<'a>
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
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.