#[non_exhaustive]pub enum ProfileFieldValue {
AvatarUrl(OwnedMxcUri),
DisplayName(String),
TimeZone(String),
Status(StatusProfileField),
Call(CallProfileField),
}Expand description
The possible values of a field of a user’s profile.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AvatarUrl(OwnedMxcUri)
The user’s avatar URL.
DisplayName(String)
The user’s display name.
TimeZone(String)
The user’s time zone.
Status(StatusProfileField)
unstable-msc4426 only.The user’s current status.
This uses the unstable prefix defined in MSC4426.
Call(CallProfileField)
unstable-msc4426 only.The user’s call indicator.
This uses the unstable prefix defined in MSC4426.
Implementations§
Source§impl ProfileFieldValue
impl ProfileFieldValue
Sourcepub fn new(field: &str, value: Value) -> Result<ProfileFieldValue, Error>
Available on crate feature api and (crate features client-api-c or client-api-s) and (crate features client or server) only.
pub fn new(field: &str, value: Value) -> Result<ProfileFieldValue, Error>
api and (crate features client-api-c or client-api-s) and (crate features client or server) only.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
Available on crate feature api and (crate features client-api-c or client-api-s) and (crate features client or server) only.
pub fn field_name(&self) -> ProfileFieldName
api and (crate features client-api-c or client-api-s) and (crate features client or server) only.The name of the field for this value.
Sourcepub fn value(&self) -> Cow<'_, Value>
Available on crate feature api and (crate features client-api-c or client-api-s) and (crate features client or server) only.
pub fn value(&self) -> Cow<'_, Value>
api and (crate features client-api-c or client-api-s) and (crate features client or server) only.Returns the value of the field.
Prefer to use the public variants of ProfileFieldValue where possible; this method is
meant to be used for custom fields only.
Trait Implementations§
Source§impl Clone for ProfileFieldValue
impl Clone for ProfileFieldValue
Source§fn clone(&self) -> ProfileFieldValue
fn clone(&self) -> ProfileFieldValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)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>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Extend<ProfileFieldValue> for UserProfile
impl Extend<ProfileFieldValue> for UserProfile
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>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)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>,
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>,
Source§impl FromIterator<ProfileFieldValue> for UserProfile
impl FromIterator<ProfileFieldValue> for UserProfile
Source§fn from_iter<T>(iter: T) -> UserProfilewhere
T: IntoIterator<Item = ProfileFieldValue>,
fn from_iter<T>(iter: T) -> UserProfilewhere
T: IntoIterator<Item = ProfileFieldValue>,
Source§impl PartialEq for ProfileFieldValue
impl PartialEq for ProfileFieldValue
Source§fn eq(&self, other: &ProfileFieldValue) -> bool
fn eq(&self, other: &ProfileFieldValue) -> bool
self and other values to be equal, and is used by ==.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,
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
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
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more