[][src]Struct swim_structure::item::Slot

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

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

Examples

Construct a new Slot field:

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

Methods

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

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

pub fn get_key(&self) -> &Value<'a>[src]

Returns a reference to this Slot's key.

pub fn get_val(&self) -> &Value<'a>[src]

Returns a reference to this Slot's value.

pub fn get_val_mut(&mut self) -> &mut Value<'a>[src]

Returns a mutable reference to this Slot's value.

pub fn get_key_val(&self) -> (&Value<'a>, &Value<'a>)[src]

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

pub fn get_key_val_mut(&mut self) -> (&Value<'a>, &mut Value<'a>)[src]

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

pub fn as_field(&self) -> &Field<'a>[src]

Upcasts this Slot reference to a Field reference.

pub fn as_mut_field(&mut self) -> &mut Field<'a>[src]

Upcasts this Slot reference to a mutable Field reference.

pub fn as_item(&self) -> &Item<'a>[src]

Upcasts this Slot reference to an Item reference.

pub fn as_mut_item(&mut self) -> &mut Item<'a>[src]

Upcasts this Slot reference to a mutable Item reference.

pub fn into_key(self) -> Value<'a>[src]

Returns this Slot's key, dropping its value.

pub fn into_val(self) -> Value<'a>[src]

Returns this Slot's value, dropping its key.

pub fn into_key_val(self) -> (Value<'a>, Value<'a>)[src]

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

pub fn into_field(self) -> Field<'a>[src]

Upcasts this Slot to a Field.

pub fn into_item(self) -> Item<'a>[src]

Upcasts this Slot to an Item.

Trait Implementations

impl<'a> PartialEq<Slot<'a>> for Slot<'a>[src]

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

impl<'a> From<Slot<'a>> for Item<'a>[src]

impl<'a> From<Slot<'a>> for Field<'a>[src]

impl<'a> Debug for Slot<'a>[src]

impl<'a> Hash for Slot<'a>[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

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

impl<'a> AsMut<Field<'a>> for Slot<'a>[src]

impl<'a> AsMut<Item<'a>> for Slot<'a>[src]

impl<'a> AsRef<Field<'a>> for Slot<'a>[src]

impl<'a> AsRef<Item<'a>> for Slot<'a>[src]

Auto Trait Implementations

impl<'a> Send for Slot<'a>

impl<'a> Sync for Slot<'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]