Type Alias starlark::values::record::Record

source ·
pub type Record<'v> = RecordGen<Value<'v>>;
Expand description

Type of value.

Aliased Type§

struct Record<'v> { /* private fields */ }

Implementations§

source§

impl<'v> Record<'v>

source

pub fn from_value(x: Value<'v>) -> Option<&'v Self>

Downcast the value.

Trait Implementations§

source§

impl<'v> AllocValue<'v> for Record<'v>

source§

fn alloc_value(self, heap: &'v Heap) -> Value<'v>

Allocate the value on a heap and return a reference to the allocated value. Read more
source§

impl<'v> StarlarkTypeRepr for &'v Record<'v>

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 Record<'v>

source§

fn unpack_value(x: Value<'v>) -> Option<&'v Record<'v>>

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.