#[non_exhaustive]pub enum ProfileFieldValue {
AvatarUrl(OwnedMxcUri),
DisplayName(String),
}
Available on crate feature
api
and (crate features client-api-c
or client-api-s
) only.Expand description
The possible values of a field of a user’s profile.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl ProfileFieldValue
impl ProfileFieldValue
Sourcepub fn new(field: &str, value: Value) -> Result<ProfileFieldValue, Error>
pub fn new(field: &str, value: Value) -> Result<ProfileFieldValue, Error>
Construct a new ProfileFieldValue
with the given field and value.
Prefer to use the public variants of ProfileFieldValue
where possible; this constructor is
meant to be used for unsupported fields only and does not allow setting arbitrary data for
supported ones.
§Errors
Returns an error if the field
is known and serialization of value
to the corresponding
ProfileFieldValue
variant fails.
Sourcepub fn field_name(&self) -> ProfileFieldName
pub fn field_name(&self) -> ProfileFieldName
The name of the field for this value.
Trait Implementations§
Source§impl Clone for ProfileFieldValue
impl Clone for ProfileFieldValue
Source§fn clone(&self) -> ProfileFieldValue
fn clone(&self) -> ProfileFieldValue
Returns a duplicate 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 ProfileFieldValue
impl Debug for ProfileFieldValue
Source§impl<'de> Deserialize<'de> for ProfileFieldValue
impl<'de> Deserialize<'de> for ProfileFieldValue
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ProfileFieldValue, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ProfileFieldValue, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Extend<ProfileFieldValue> for Response
impl Extend<ProfileFieldValue> for Response
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = ProfileFieldValue>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = ProfileFieldValue>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<ProfileFieldValue> for Response
impl FromIterator<ProfileFieldValue> for Response
Source§fn from_iter<T>(iter: T) -> Responsewhere
T: IntoIterator<Item = ProfileFieldValue>,
fn from_iter<T>(iter: T) -> Responsewhere
T: IntoIterator<Item = ProfileFieldValue>,
Creates a value from an iterator. Read more
Source§impl PartialEq for ProfileFieldValue
impl PartialEq for ProfileFieldValue
Source§impl Serialize for ProfileFieldValue
impl Serialize for ProfileFieldValue
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 Eq for ProfileFieldValue
impl StructuralPartialEq for ProfileFieldValue
Auto Trait Implementations§
impl Freeze for ProfileFieldValue
impl RefUnwindSafe for ProfileFieldValue
impl Send for ProfileFieldValue
impl Sync for ProfileFieldValue
impl Unpin for ProfileFieldValue
impl UnwindSafe for ProfileFieldValue
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.