[][src]Struct swim_structure::item::Attr

#[repr(C)]
pub struct Attr<'a> { /* fields omitted */ }
[]

Field variant representing a key-value attribute with a Text key and a Value-typed value.

Examples

Construct a new Attr field:

let field = Attr::new(Text::from_str("a"), Value::from(true));

Methods

impl<'a> Attr<'a>[src][]

pub fn new(key: Text<'a>, val: Value<'a>) -> Attr<'a>[src]

Returns a reference to this Attr's key.

Returns a reference to this Attr's value.

Returns a mutable reference to this Attr's value.

Returns a pair of references to this Attr's key and value.

Returns a pair of references to this Attr's key and mutable value.

Upcasts this Attr reference to a Field reference.

Upcasts this Attr reference to a mutable Field reference.

Upcasts this Attr reference to an Item reference.

Upcasts this Attr reference to a mutable Item reference.

Returns this Attr's key, dropping its value.

Returns this Attr's value, dropping its key.

Returns this Attr's key and value as a pair.

Upcasts this Attr to a Field.

Upcasts this Attr to an Item.

Trait Implementations

impl<'a> PartialEq<Attr<'a>> for Attr<'a>[src][+]

This method tests for !=.

impl<'a> Eq for Attr<'a>[src]

impl<'a> From<Attr<'a>> for Item<'a>[src][+]

impl<'a> From<Attr<'a>> for Field<'a>[src][+]

impl<'a> Debug for Attr<'a>[src][+]

impl<'a> Hash for Attr<'a>[src][+]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a> AsMut<Field<'a>> for Attr<'a>[src][+]

impl<'a> AsMut<Item<'a>> for Attr<'a>[src][+]

impl<'a> AsRef<Field<'a>> for Attr<'a>[src][+]

impl<'a> AsRef<Item<'a>> for Attr<'a>[src][+]

Auto Trait Implementations

impl<'a> !Send for Attr<'a>

impl<'a> !Sync for Attr<'a>

Blanket Implementations

impl<T> From for T[src][]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src][]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src][]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src][]

impl<T> Borrow for T where
    T: ?Sized
[src][]

impl<T> BorrowMut for T where
    T: ?Sized
[src][]

impl<T> Any for T where
    T: 'static + ?Sized
[src][]

impl<'b, S, T> StowFrom for T where
    S: Stow<'b, T>, 
[src][]

default fn stow_from(value: T, hold: &dyn Hold<'b>) -> Self[src]

impl<'b, S, T> StowInto for S where
    T: StowFrom<'b, S>, 
[src][]

default fn stow_into(self, hold: &dyn Hold<'b>) -> T[src]