pub struct FrozenTupleRef { /* private fields */ }
Expand description

Reference to tuple data in frozen Starlark heap.

Implementations§

source§

impl FrozenTupleRef

source

pub const TYPE: &'static str = FrozenTuple::TYPE

type(()), which is "tuple".

source

pub fn from_frozen_value(value: FrozenValue) -> Option<&'static FrozenTupleRef>

Downcast a value to a tuple.

source

pub fn len(&self) -> usize

Number of elements.

source

pub fn content(&self) -> &[FrozenValue]

Tuple elements.

source

pub fn iter(&self) -> impl ExactSizeIterator<Item = FrozenValue> + '_

Iterate over contents.

Trait Implementations§

source§

impl Debug for FrozenTupleRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> StarlarkTypeRepr for &'a FrozenTupleRef

source§

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 FrozenTupleRef

source§

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 expected() -> String

Description of values acceptable by unpack_value, e. g. list or str.
source§

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>

Unpack value, but instead of None return error about incorrect argument type.
source§

fn unpack_named_param(value: Value<'v>, param_name: &str) -> Result<Self>

Unpack value, but instead of None return error about incorrect named argument type.
source§

impl Coerce<[FrozenValue]> for FrozenTupleRef

source§

impl Coerce<FrozenTupleRef> for [FrozenValue]

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more