pub struct Attributes(pub Object<Attribute>);
Expand description
Wrapper struct around a collection of attributes with some convenience methods.
Tuple Fields§
§0: Object<Attribute>
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn get_value<Q>(&self, key: &Q) -> Option<&Value>
pub fn get_value<Q>(&self, key: &Q) -> Option<&Value>
Returns the value of the attribute with the given key.
Sourcepub fn get_attribute<Q>(&self, key: &Q) -> Option<&Attribute>
pub fn get_attribute<Q>(&self, key: &Q) -> Option<&Attribute>
Returns the attribute with the given key.
Sourcepub fn insert<V: Into<AttributeValue>>(&mut self, key: String, value: V)
pub fn insert<V: Into<AttributeValue>>(&mut self, key: String, value: V)
Inserts an attribute with the given value into this collection.
Sourcepub fn insert_raw(&mut self, key: String, attribute: Annotated<Attribute>)
pub fn insert_raw(&mut self, key: String, attribute: Annotated<Attribute>)
Inserts an annotated attribute into this collection.
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Checks whether this collection contains an attribute with the given key.
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
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 Debug for Attributes
impl Debug for Attributes
Source§impl Default for Attributes
impl Default for Attributes
Source§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
Source§impl Empty for Attributes
impl Empty for Attributes
Source§impl FromIterator<(String, Annotated<Attribute>)> for Attributes
impl FromIterator<(String, Annotated<Attribute>)> for Attributes
Source§impl FromValue for Attributes
impl FromValue for Attributes
Source§fn from_value(__value: Annotated<Value>) -> Annotated<Self>
fn from_value(__value: Annotated<Value>) -> Annotated<Self>
Creates a meta structure from an annotated boxed value.
Source§impl IntoIterator for Attributes
impl IntoIterator for Attributes
Source§impl IntoValue for Attributes
impl IntoValue for Attributes
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Boxes the meta structure back into a value.
Source§fn serialize_payload<S>(
&self,
__serializer: S,
__behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
fn serialize_payload<S>(
&self,
__serializer: S,
__behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
Efficiently serializes the payload directly.
Source§fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
Extracts children meta map out of a value.
§fn extract_meta_tree(value: &Annotated<Self>) -> MetaTreewhere
Self: Sized,
fn extract_meta_tree(value: &Annotated<Self>) -> MetaTreewhere
Self: Sized,
Extracts the meta tree out of annotated value. Read more
Source§impl PartialEq for Attributes
impl PartialEq for Attributes
Source§impl ProcessValue for Attributes
impl ProcessValue for Attributes
Source§fn value_type(&self) -> EnumSet<ValueType>
fn value_type(&self) -> EnumSet<ValueType>
Returns the type of the value.
Source§fn process_value<P>(
&mut self,
__meta: &mut Meta,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
fn process_value<P>(
&mut self,
__meta: &mut Meta,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
Executes a processor on this value.
Source§fn process_child_values<P>(
&mut self,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
fn process_child_values<P>(
&mut self,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
Recurses into children of this value.
impl StructuralPartialEq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
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