pub enum ArrayValue {
Show 18 variants Sum(Vec<SumValue>), Product(Vec<ProductValue>), Bool(Vec<bool>), I8(Vec<i8>), U8(Vec<u8>), I16(Vec<i16>), U16(Vec<u16>), I32(Vec<i32>), U32(Vec<u32>), I64(Vec<i64>), U64(Vec<u64>), I128(Vec<i128>), U128(Vec<u128>), F32(Vec<F32>), F64(Vec<F64>), String(Vec<String>), Array(Vec<ArrayValue>), Map(Vec<MapValue>),
}
Expand description

An array value in “monomorphized form”.

Arrays are represented in this way monomorphized fashion for efficiency rather than unnecessary indirections and tags of AlgebraicValue. We can do this as we know statically that the type of each element is the same as arrays are homogenous dynamically sized product types.

Variants§

§

Sum(Vec<SumValue>)

An array of SumValues.

§

Product(Vec<ProductValue>)

An array of ProductValues.

§

Bool(Vec<bool>)

An array of bools.

§

I8(Vec<i8>)

An array of i8s.

§

U8(Vec<u8>)

An array of u8s.

§

I16(Vec<i16>)

An array of i16s.

§

U16(Vec<u16>)

An array of u16s.

§

I32(Vec<i32>)

An array of i32s.

§

U32(Vec<u32>)

An array of u32s.

§

I64(Vec<i64>)

An array of i64s.

§

U64(Vec<u64>)

An array of u64s.

§

I128(Vec<i128>)

An array of i128s.

§

U128(Vec<u128>)

An array of u128s.

§

F32(Vec<F32>)

An array of totally ordered F32s.

§

F64(Vec<F64>)

An array of totally ordered F64s.

§

String(Vec<String>)

An array of UTF-8 strings.

§

Array(Vec<ArrayValue>)

An array of arrays.

§

Map(Vec<MapValue>)

An array of maps.

Implementations§

source§

impl ArrayValue

source

pub fn len(&self) -> usize

Returns the length of the array.

source

pub fn is_empty(&self) -> bool

Returns whether the array is empty.

source

pub fn iter_cloned(&self) -> ArrayValueIterCloned<'_>

Returns a cloning iterator on the elements of self as AlgebraicValues.

Trait Implementations§

source§

impl Clone for ArrayValue

source§

fn clone(&self) -> ArrayValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ArrayValue

source§

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

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

impl Default for ArrayValue

source§

fn default() -> Self

The default ArrayValue is an empty array of sum values.

source§

impl<const N: usize> From<[ArrayValue; N]> for ArrayValue

source§

fn from(v: [ArrayValue; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[BTreeMap<AlgebraicValue, AlgebraicValue>; N]> for ArrayValue

source§

fn from(v: [MapValue; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[ConstrainedFloat<f32, UnitConstraint<f32>>; N]> for ArrayValue

source§

fn from(v: [F32; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[ConstrainedFloat<f64, UnitConstraint<f64>>; N]> for ArrayValue

source§

fn from(v: [F64; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[ProductValue; N]> for ArrayValue

source§

fn from(v: [ProductValue; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[String; N]> for ArrayValue

source§

fn from(v: [String; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[SumValue; N]> for ArrayValue

source§

fn from(v: [SumValue; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[bool; N]> for ArrayValue

source§

fn from(v: [bool; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[i128; N]> for ArrayValue

source§

fn from(v: [i128; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[i16; N]> for ArrayValue

source§

fn from(v: [i16; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[i32; N]> for ArrayValue

source§

fn from(v: [i32; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[i64; N]> for ArrayValue

source§

fn from(v: [i64; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[i8; N]> for ArrayValue

source§

fn from(v: [i8; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[u128; N]> for ArrayValue

source§

fn from(v: [u128; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[u16; N]> for ArrayValue

source§

fn from(v: [u16; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[u32; N]> for ArrayValue

source§

fn from(v: [u32; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[u64; N]> for ArrayValue

source§

fn from(v: [u64; N]) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[u8; N]> for ArrayValue

source§

fn from(v: [u8; N]) -> Self

Converts to this type from the input type.
source§

impl From<ArrayValue> for AlgebraicValue

source§

fn from(original: ArrayValue) -> AlgebraicValue

Converts to this type from the input type.
source§

impl From<Vec<ArrayValue>> for ArrayValue

source§

fn from(v: Vec<ArrayValue>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<BTreeMap<AlgebraicValue, AlgebraicValue>>> for ArrayValue

source§

fn from(v: Vec<MapValue>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<ConstrainedFloat<f32, UnitConstraint<f32>>>> for ArrayValue

source§

fn from(v: Vec<F32>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<ConstrainedFloat<f64, UnitConstraint<f64>>>> for ArrayValue

source§

fn from(v: Vec<F64>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<ProductValue>> for ArrayValue

source§

fn from(v: Vec<ProductValue>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<String>> for ArrayValue

source§

fn from(v: Vec<String>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<SumValue>> for ArrayValue

source§

fn from(v: Vec<SumValue>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<bool>> for ArrayValue

source§

fn from(v: Vec<bool>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i128>> for ArrayValue

source§

fn from(v: Vec<i128>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i16>> for ArrayValue

source§

fn from(v: Vec<i16>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i32>> for ArrayValue

source§

fn from(v: Vec<i32>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i64>> for ArrayValue

source§

fn from(v: Vec<i64>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<i8>> for ArrayValue

source§

fn from(v: Vec<i8>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u128>> for ArrayValue

source§

fn from(v: Vec<u128>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u16>> for ArrayValue

source§

fn from(v: Vec<u16>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u32>> for ArrayValue

source§

fn from(v: Vec<u32>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u64>> for ArrayValue

source§

fn from(v: Vec<u64>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for ArrayValue

source§

fn from(v: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl Hash for ArrayValue

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IntoIterator for ArrayValue

§

type Item = AlgebraicValue

The type of the elements being iterated over.
§

type IntoIter = ArrayValueIntoIter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl Ord for ArrayValue

source§

fn cmp(&self, other: &ArrayValue) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for ArrayValue

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ArrayValue

source§

fn partial_cmp(&self, other: &ArrayValue) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for ArrayValue

source§

fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>

Serialize self in the data format of S using the provided serializer.
source§

impl Value for ArrayValue

§

type Type = ArrayType

The type of this value.
source§

impl Eq for ArrayValue

source§

impl StructuralPartialEq for ArrayValue

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> Satn for T
where T: Serialize + ?Sized,

source§

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

Formats the value using the SATN data format into the formatter f.
source§

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

Formats the value using the postgres SATN data format into the formatter f.
source§

fn to_satn(&self) -> String

Formats the value using the SATN data format into the returned String.
source§

fn to_satn_pretty(&self) -> String

Pretty prints the value using the SATN data format into the returned String.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more