pub struct TupleRef<'v> { /* private fields */ }
Expand description
Reference to tuple data in Starlark heap.
Implementations§
source§impl<'v> TupleRef<'v>
impl<'v> TupleRef<'v>
sourcepub fn from_value(value: Value<'v>) -> Option<&'v TupleRef<'v>>
pub fn from_value(value: Value<'v>) -> Option<&'v TupleRef<'v>>
Downcast a value to a tuple.
sourcepub fn from_frozen_value(value: FrozenValue) -> Option<&'v TupleRef<'v>>
pub fn from_frozen_value(value: FrozenValue) -> Option<&'v TupleRef<'v>>
Downcast a value to a tuple.
sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = Value<'v>> + '_
pub fn iter(&self) -> impl ExactSizeIterator<Item = Value<'v>> + '_
Iterate over the contents.
Trait Implementations§
source§impl<'v> StarlarkTypeRepr for &'v TupleRef<'v>
impl<'v> StarlarkTypeRepr for &'v TupleRef<'v>
source§fn starlark_type_repr() -> Ty
fn starlark_type_repr() -> Ty
The representation of a type that a user would use verbatim in starlark type annotations
source§impl<'v> UnpackValue<'v> for &'v TupleRef<'v>
impl<'v> UnpackValue<'v> for &'v TupleRef<'v>
source§fn unpack_value(value: Value<'v>) -> Option<Self>
fn unpack_value(value: Value<'v>) -> Option<Self>
Given a
Value
, try and unpack it into the given type, which may involve some element of conversion.source§fn unpack_value_err(value: Value<'v>) -> Result<Self>
fn unpack_value_err(value: Value<'v>) -> Result<Self>
Unpack a value, but return error instead of
None
if unpacking fails.source§fn unpack_param(value: Value<'v>) -> Result<Self>
fn unpack_param(value: Value<'v>) -> Result<Self>
Unpack value, but instead of
None
return error about incorrect argument type.