pub struct Tuple<T>(/* private fields */);Expand description
This type is used to store anything shaped like an espy tuple.
This includes:
- Tuple<
Value> (an espy tuple) - Tuple<
StaticValue> (an espy tuple with a static lifetime) - Tuple<
ComplexType> (the type of an espy tuple)
It is either a “numeric” tuple (indexed only by order) or a “named” tuple (indexed by both order and name).
Implementations§
Source§impl<T> Tuple<T>
impl<T> Tuple<T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn value(&self, index: usize) -> Option<&T>
pub fn find_value(&self, name: &str) -> Option<&T>
pub fn values(&self) -> impl Iterator<Item = &T>
pub fn as_numeric(&self) -> Option<&[T]>
pub fn as_named(&self) -> Option<&[(Rc<str>, T)]>
Source§impl Tuple<StaticValue>
impl Tuple<StaticValue>
pub fn to_runtime<'host>(&self) -> Tuple<Value<'host>>
Trait Implementations§
Source§impl From<Tuple<ComplexType>> for ComplexType
impl From<Tuple<ComplexType>> for ComplexType
Source§fn from(value: Tuple<ComplexType>) -> Self
fn from(value: Tuple<ComplexType>) -> Self
Converts to this type from the input type.
Source§impl From<Tuple<ComplexType>> for Tuple<Value<'_>>
impl From<Tuple<ComplexType>> for Tuple<Value<'_>>
Source§fn from(tuple: Tuple<ComplexType>) -> Self
fn from(tuple: Tuple<ComplexType>) -> Self
Converts to this type from the input type.
impl<T: Eq> Eq for Tuple<T>
impl<T> StructuralPartialEq for Tuple<T>
Auto Trait Implementations§
impl<T> Freeze for Tuple<T>
impl<T> RefUnwindSafe for Tuple<T>where
T: RefUnwindSafe,
impl<T> !Send for Tuple<T>
impl<T> !Sync for Tuple<T>
impl<T> Unpin for Tuple<T>
impl<T> UnwindSafe for Tuple<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more