Enum ProfileFieldValue
#[non_exhaustive]pub enum ProfileFieldValue {
AvatarUrl(OwnedMxcUri),
DisplayName(String),
}
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§
§impl ProfileFieldValue
impl ProfileFieldValue
pub 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.
pub fn field_name(&self) -> ProfileFieldName
pub fn field_name(&self) -> ProfileFieldName
The name of the field for this value.
Trait Implementations§
§impl Clone for ProfileFieldValue
impl Clone for ProfileFieldValue
§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 more§impl Debug for ProfileFieldValue
impl Debug for ProfileFieldValue
§impl<'de> Deserialize<'de> for ProfileFieldValue
impl<'de> Deserialize<'de> for ProfileFieldValue
§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
§impl Extend<ProfileFieldValue> for Response
impl Extend<ProfileFieldValue> for Response
§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
§impl FromIterator<ProfileFieldValue> for Response
impl FromIterator<ProfileFieldValue> for Response
§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
§impl PartialEq for ProfileFieldValue
impl PartialEq for ProfileFieldValue
§impl Serialize for ProfileFieldValue
impl Serialize for ProfileFieldValue
§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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync 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
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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