[−][src]Struct swim_structure::item::Attr
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]
pub fn get_key(&self) -> &Text<'a>
[src][+]
pub fn get_val(&self) -> &Value<'a>
[src][+]
pub fn get_val_mut(&mut self) -> &mut Value<'a>
[src][+]
pub fn get_key_val(&self) -> (&Text<'a>, &Value<'a>)
[src][+]
pub fn get_key_val_mut(&mut self) -> (&Text<'a>, &mut Value<'a>)
[src][+]
pub fn as_field(&self) -> &Field<'a>
[src][+]
pub fn as_mut_field(&mut self) -> &mut Field<'a>
[src][+]
pub fn as_item(&self) -> &Item<'a>
[src][+]
pub fn as_mut_item(&mut self) -> &mut Item<'a>
[src][+]
pub fn into_key(self) -> Text<'a>
[src][+]
pub fn into_val(self) -> Value<'a>
[src][+]
pub fn into_key_val(self) -> (Text<'a>, Value<'a>)
[src][+]
pub fn into_field(self) -> Field<'a>
[src][+]
pub fn into_item(self) -> Item<'a>
[src][+]
Trait Implementations
impl<'a> PartialEq<Attr<'a>> for Attr<'a>
[src][+]
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][+]
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
Blanket Implementations
impl<T> From for T
[src][−]
impl<T, U> TryFrom for T where
U: Into<T>,
[src][−]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][+]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][−]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][+]
impl<T, U> Into for T where
U: From<T>,
[src][−]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src][−]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][−]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][+]
impl<T> Any for T where
T: 'static + ?Sized,
[src][−]
T: 'static + ?Sized,
impl<'b, S, T> StowFrom for T where
S: Stow<'b, T>,
[src][−]
S: Stow<'b, T>,
default fn try_stow_from(
src: S,
hold: &dyn Hold<'b>
) -> Result<T, (S, HoldError)>
[src][+]
src: S,
hold: &dyn Hold<'b>
) -> Result<T, (S, HoldError)>
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][−]
T: StowFrom<'b, S>,