Skip to main content

ConstructedValue

Enum ConstructedValue 

Source
pub enum ConstructedValue {
Show 13 variants Absent, Declared { value: Box<ConstructedValue>, declaration: DeclaredType<()>, }, Boolean(bool), Integer(i64), Float(f64), String(String), Member(NominalMember), KeyedArray { axes: Vec<KeyAxis>, entries: Vec<KeyedEntry>, }, Array(Vec<ConstructedValue>), Tuple(Vec<ConstructedValue>), Record(Vec<(String, ConstructedValue)>), Dictionary(Dictionary), Set { element_type: Option<SetElementType>, elements: SetElements, },
}
Expand description

Owned constructed data. Arrays have positive one-based positions. Tuples and records retain field order; sets retain each first inserted element. Keyed arrays retain nonzero typed axes and sparse row-major entries; supplied axes need not be contiguous or cover a full Cartesian product. Public construction is checked by the budgeted entry points before use. Derived Rust equality compares stored representations. Language set and dictionary equality compares membership and associations respectively. There is deliberately no deep Clone; use copy_constructed_value.

Variants§

§

Absent

§

Declared

An admitted immutable value with an explicit constructed declaration.

Fields

§declaration: DeclaredType<()>
§

Boolean(bool)

§

Integer(i64)

§

Float(f64)

§

String(String)

§

Member(NominalMember)

§

KeyedArray

Fields

§axes: Vec<KeyAxis>
§entries: Vec<KeyedEntry>
§

Array(Vec<ConstructedValue>)

§

Tuple(Vec<ConstructedValue>)

§

Record(Vec<(String, ConstructedValue)>)

§

Dictionary(Dictionary)

General keys and values, retaining insertion order. String-only dictionaries use Record for structural field access and existing host compatibility.

§

Set

Fields

§element_type: Option<SetElementType>
§elements: SetElements

Implementations§

Source§

impl ConstructedValue

Source

pub fn data(&self) -> &ConstructedValue

Borrow data through its transparent declaration annotation.

Source

pub fn occurs(&self) -> bool

Whether this value is present, including false, zero and empty data.

Source

pub fn into_data(self) -> ConstructedValue

Consume transparent annotations when crossing an explicit data boundary.

Trait Implementations§

Source§

impl Debug for ConstructedValue

Source§

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

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

impl PartialEq for ConstructedValue

Source§

fn eq(&self, other: &ConstructedValue) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConstructedValue

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.