ArrayValue

Enum ArrayValue 

Source
pub enum ArrayValue {
Show 19 variants Sum(Box<[SumValue]>), Product(Box<[ProductValue]>), Bool(Box<[bool]>), I8(Box<[i8]>), U8(Box<[u8]>), I16(Box<[i16]>), U16(Box<[u16]>), I32(Box<[i32]>), U32(Box<[u32]>), I64(Box<[i64]>), U64(Box<[u64]>), I128(Box<[i128]>), U128(Box<[u128]>), I256(Box<[i256]>), U256(Box<[u256]>), F32(Box<[F32]>), F64(Box<[F64]>), String(Box<[Box<str>]>), Array(Box<[ArrayValue]>),
}
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(Box<[SumValue]>)

An array of SumValues.

§

Product(Box<[ProductValue]>)

An array of ProductValues.

§

Bool(Box<[bool]>)

An array of bools.

§

I8(Box<[i8]>)

An array of i8s.

§

U8(Box<[u8]>)

An array of u8s.

§

I16(Box<[i16]>)

An array of i16s.

§

U16(Box<[u16]>)

An array of u16s.

§

I32(Box<[i32]>)

An array of i32s.

§

U32(Box<[u32]>)

An array of u32s.

§

I64(Box<[i64]>)

An array of i64s.

§

U64(Box<[u64]>)

An array of u64s.

§

I128(Box<[i128]>)

An array of i128s.

§

U128(Box<[u128]>)

An array of u128s.

§

I256(Box<[i256]>)

An array of i256s.

§

U256(Box<[u256]>)

An array of u256s.

§

F32(Box<[F32]>)

An array of totally ordered F32s.

§

F64(Box<[F64]>)

An array of totally ordered F64s.

§

String(Box<[Box<str>]>)

An array of UTF-8 strings.

§

Array(Box<[ArrayValue]>)

An array of arrays.

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 duplicate 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<[Box<str>; N]> for ArrayValue

Source§

fn from(v: [Box<str>; 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<[I256; N]> for ArrayValue

Source§

fn from(v: [i256; 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<[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<[U256; N]> for ArrayValue

Source§

fn from(v: [u256; 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<Box<[ArrayValue]>> for ArrayValue

Source§

fn from(v: Box<[ArrayValue]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[Box<str>]>> for ArrayValue

Source§

fn from(v: Box<[Box<str>]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[ConstrainedFloat<f32, UnitConstraint<f32>>]>> for ArrayValue

Source§

fn from(v: Box<[F32]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[ConstrainedFloat<f64, UnitConstraint<f64>>]>> for ArrayValue

Source§

fn from(v: Box<[F64]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[I256]>> for ArrayValue

Source§

fn from(v: Box<[i256]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[ProductValue]>> for ArrayValue

Source§

fn from(v: Box<[ProductValue]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[SumValue]>> for ArrayValue

Source§

fn from(v: Box<[SumValue]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[U256]>> for ArrayValue

Source§

fn from(v: Box<[u256]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[bool]>> for ArrayValue

Source§

fn from(v: Box<[bool]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[i128]>> for ArrayValue

Source§

fn from(v: Box<[i128]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[i16]>> for ArrayValue

Source§

fn from(v: Box<[i16]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[i32]>> for ArrayValue

Source§

fn from(v: Box<[i32]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[i64]>> for ArrayValue

Source§

fn from(v: Box<[i64]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[i8]>> for ArrayValue

Source§

fn from(v: Box<[i8]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[u128]>> for ArrayValue

Source§

fn from(v: Box<[u128]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[u16]>> for ArrayValue

Source§

fn from(v: Box<[u16]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[u32]>> for ArrayValue

Source§

fn from(v: Box<[u32]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[u64]>> for ArrayValue

Source§

fn from(v: Box<[u64]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[u8]>> for ArrayValue

Source§

fn from(v: Box<[u8]>) -> Self

Converts to this type from the input type.
Source§

impl Hash for ArrayValue

The hash function for an ArrayValue only hashes its domain types. This avoids the hashing Discriminant<ArrayValue> which is OK as a table column will only ever have the same type (and so the same discriminant). The hash function will however length-prefix as the value is of variable length.

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

Source§

type Item = AlgebraicValue

The type of the elements being iterated over.
Source§

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,

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

impl PartialEq for ArrayValue

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

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

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

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

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 SizeOf for ArrayValue

Source§

fn size_of(&self) -> usize

Returns the unpadded size in bytes of an AlgebraicValue or primitive
Source§

impl Value for ArrayValue

Source§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

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<'_>, ty: &PsqlType<'_>) -> Result

Formats the value using the postgres SATN(PsqlFormatter { f }, /* PsqlType */) 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,

Source§

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>,

Source§

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>,

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.