[−][src]Struct swim_structure::item::Field
Item
variant representing a key-value pair with a Value
-typed key
and value.
Methods
impl<'a> Field<'a>
[src]
pub fn get_key(&self) -> &Value<'a>
[src]
Returns a reference to this Field
's key.
pub fn get_val(&self) -> &Value<'a>
[src]
Returns a reference to this Field
's value.
pub fn get_val_mut(&mut self) -> &mut Value<'a>
[src]
Returns a mutable reference to this Field
's value.
pub fn get_key_val(&self) -> (&Value<'a>, &Value<'a>)
[src]
Returns a pair of references to this Field
'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 Field
's key and mutable value.
pub fn into_key(self) -> Value<'a>
[src]
Returns this Field
's key, dropping its value.
pub fn into_val(self) -> Value<'a>
[src]
Returns this Field
's value, dropping its key.
pub fn into_key_val(self) -> (Value<'a>, Value<'a>)
[src]
Returns this Field
's key and value as a pair.
pub fn is_attr(&self) -> bool
[src]
Returns true
if this Field
is an Attr
.
pub fn is_slot(&self) -> bool
[src]
Returns true
if this Field
is a Slot
.
pub fn as_attr(&self) -> &Attr<'a>
[src]
Downcasts this Field
reference to an Attr
reference.
Panics
Panics if this Field
is not, in fact, an Attr
.
pub fn as_mut_attr(&mut self) -> &mut Attr<'a>
[src]
Downcasts this Field
reference to a mutable Attr
reference.
Panics
Panics if this Field
is not, in fact, an Attr
.
pub fn as_slot(&self) -> &Slot<'a>
[src]
Downcasts this Field
reference to a Slot
reference.
Panics
Panics if this Field
is not, in fact, a Slot
.
pub fn as_mut_slot(&mut self) -> &mut Slot<'a>
[src]
Downcasts this Field
reference to a mutable Slot
reference.
Panics
Panics if this Field
is not, in fact, a Slot
.
pub unsafe fn as_attr_unchecked(&self) -> &Attr<'a>
[src]
Reinterprets this Field
reference as an Attr
reference.
Safety
Does not verify that this Field
is, in fact, an Attr
.
pub unsafe fn as_mut_attr_unchecked(&mut self) -> &mut Attr<'a>
[src]
Reinterprets this Field
reference as a mutable Attr
reference.
Safety
Does not verify that this Field
is, in fact, an Attr
.
pub unsafe fn as_slot_unchecked(&self) -> &Slot<'a>
[src]
Reinterprets this Field
reference as a Slot
reference.
Safety
Does not verify that this Field
is, in fact, a Slot
.
pub unsafe fn as_mut_slot_unchecked(&mut self) -> &mut Slot<'a>
[src]
Reinterprets this Field
reference as a mutable Slot
reference.
Safety
Does not verify that this Field
is, in fact, a Slot
.
pub fn as_item(&self) -> &Item<'a>
[src]
Upcasts this Field
reference to an Item
reference.
pub fn as_mut_item(&mut self) -> &mut Item<'a>
[src]
Upcasts this Field
reference to a mutable Item
reference.
pub fn into_attr(self) -> Attr<'a>
[src]
pub fn into_slot(self) -> Slot<'a>
[src]
pub unsafe fn into_attr_unchecked(self) -> Attr<'a>
[src]
pub unsafe fn into_slot_unchecked(self) -> Slot<'a>
[src]
pub fn into_item(self) -> Item<'a>
[src]
Upcasts this Field
to an Item
.
pub fn cast_as_attr(&self) -> Option<&Attr<'a>>
[src]
Downcasts this Field
reference to a typechecked Attr
reference.
pub fn cast_as_mut_attr(&mut self) -> Option<&mut Attr<'a>>
[src]
Downcasts this Field
reference to a typechecked, mutable Attr
reference.
pub fn cast_as_slot(&self) -> Option<&Slot<'a>>
[src]
Downcasts this Field
reference to a typechecked Slot
reference.
pub fn cast_as_mut_slot(&mut self) -> Option<&mut Slot<'a>>
[src]
Downcasts this Field
reference to a typechecked, mutable Slot
reference.
pub fn cast_into_attr(self) -> Option<Attr<'a>>
[src]
Downcasts this Field
to a typechecked Attr
.
pub fn cast_into_slot(self) -> Option<Slot<'a>>
[src]
Downcasts this Field
to a typechecked Slot
.
Trait Implementations
impl<'a> PartialEq<Field<'a>> for Field<'a>
[src]
fn eq(&self, _that: &Field<'a>) -> bool
[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> Eq for Field<'a>
[src]
impl<'a> From<Field<'a>> for Item<'a>
[src]
impl<'a> From<Attr<'a>> for Field<'a>
[src]
impl<'a> From<Slot<'a>> for Field<'a>
[src]
impl<'a> Debug for Field<'a>
[src]
impl<'a> Hash for Field<'a>
[src]
fn hash<H: Hasher>(&self, _hasher: &mut H)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> AsMut<Item<'a>> for Field<'a>
[src]
impl<'a> AsMut<Field<'a>> for Attr<'a>
[src]
impl<'a> AsMut<Field<'a>> for Slot<'a>
[src]
impl<'a> AsRef<Item<'a>> for Field<'a>
[src]
impl<'a> AsRef<Field<'a>> for Attr<'a>
[src]
impl<'a> AsRef<Field<'a>> for Slot<'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>,