Attributes

Struct Attributes 

Source
pub struct Attributes<'a, K, V, E>(/* private fields */)
where
    K: AttributeKey<'a>,
    V: AttributeValue<'a>,
    E: EntityState<'a, K, V> + ?Sized;

Implementations§

Source§

impl<'a, K, V, E> Attributes<'a, K, V, E>
where K: AttributeKey<'a>, V: AttributeValue<'a>, E: EntityState<'a, K, V>,

Source

pub fn get(&self, key: &str) -> Option<&str>

Source

pub fn get_inner(&self, key: &str) -> Option<&V>

Source

pub fn insert(&mut self, key: K, value: V) -> Option<V>

Source

pub fn remove(&mut self, key: &str) -> Option<V>

Source§

impl<'a, K, V, E> Attributes<'a, K, V, E>
where K: AttributeKey<'a>, V: AttributeValue<'a>, E: EntityState<'a, K, V>,

Source

pub fn entry<'b>(&'b mut self, key: K) -> Entry<'a, 'b, K, V>

Trait Implementations§

Source§

impl<'a, K, V, E> Debug for Attributes<'a, K, V, E>
where K: AttributeKey<'a>, V: AttributeValue<'a>, E: EntityState<'a, K, V>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, K, V, E> Default for Attributes<'a, K, V, E>
where K: AttributeKey<'a>, V: AttributeValue<'a>, E: EntityState<'a, K, V>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, 'de: 'a, K, V, E> Deserialize<'de> for Attributes<'a, K, V, E>
where K: AttributeKey<'a> + 'a, V: AttributeValue<'a> + 'a, E: EntityState<'a, K, V>,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a, K, V, E> PartialEq for Attributes<'a, K, V, E>
where K: AttributeKey<'a>, V: AttributeValue<'a>, E: EntityState<'a, K, V>,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, K, V, E> Serialize for Attributes<'a, K, V, E>
where K: AttributeKey<'a>, V: AttributeValue<'a>, E: EntityState<'a, K, V>,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a, K, V, E> Freeze for Attributes<'a, K, V, E>
where E: ?Sized,

§

impl<'a, K, V, E> RefUnwindSafe for Attributes<'a, K, V, E>
where K: RefUnwindSafe, V: RefUnwindSafe, E: ?Sized,

§

impl<'a, K, V, E> Send for Attributes<'a, K, V, E>
where K: Send, V: Send, E: ?Sized,

§

impl<'a, K, V, E> Sync for Attributes<'a, K, V, E>
where K: Sync, V: Sync, E: ?Sized,

§

impl<'a, K, V, E> Unpin for Attributes<'a, K, V, E>
where E: ?Sized,

§

impl<'a, K, V, E> UnwindSafe for Attributes<'a, K, V, E>
where K: RefUnwindSafe, V: RefUnwindSafe, E: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,