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 or server 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).
An email address.
Msisdn
A phone number in the MSISDN format.
PhoneNumber
A phone number as a separate country code and phone number.
The homeserver will be responsible for canonicalizing this to the MSISDN format.
Fields
§
country: &'a strThe country that the phone number is from.
This is a two-letter uppercase ISO-3166-1 alpha-2 country code.
Implementations§
Source§impl<'a> UserIdentifier<'a>
impl<'a> UserIdentifier<'a>
Sourcepub fn third_party_id(medium: &'a Medium, address: &'a str) -> Self
pub fn third_party_id(medium: &'a Medium, address: &'a str) -> Self
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§
Source§impl<'a> Clone for UserIdentifier<'a>
impl<'a> Clone for UserIdentifier<'a>
Source§fn clone(&self) -> UserIdentifier<'a>
fn clone(&self) -> UserIdentifier<'a>
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<'a> Debug for UserIdentifier<'a>
impl<'a> Debug for UserIdentifier<'a>
Source§impl<'a> From<&'a OwnedUserId> for UserIdentifier<'a>
impl<'a> From<&'a OwnedUserId> for UserIdentifier<'a>
Source§fn from(id: &'a OwnedUserId) -> Self
fn from(id: &'a OwnedUserId) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a UserId> for UserIdentifier<'a>
impl<'a> From<&'a UserId> for UserIdentifier<'a>
Source§impl<'a> PartialEq for UserIdentifier<'a>
impl<'a> PartialEq for UserIdentifier<'a>
Source§impl<'a> Serialize for UserIdentifier<'a>
impl<'a> Serialize for UserIdentifier<'a>
impl<'a> Eq for UserIdentifier<'a>
impl<'a> StructuralPartialEq for UserIdentifier<'a>
Auto Trait Implementations§
impl<'a> Freeze for UserIdentifier<'a>
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§
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> 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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.