pub enum AlgebraicValue {
}
Expand description
A value in SATS typed at some AlgebraicType
.
Values are type erased, so they do not store their type. This is important mainly for space efficiency, including network latency and bandwidth.
These are only values and not expressions.
That is, they are canonical and cannot be simplified further by some evaluation.
So forms like 42 + 24
are not represented in an AlgebraicValue
.
Variants§
Sum(SumValue)
A structural sum value.
Given a sum type { N_0(T_0), N_1(T_1), ..., N_n(T_n) }
where N_i
denotes a variant name
and where T_i
denotes the type the variant stores,
a sum value makes a specific choice as to the variant.
So for example, we might chose N_1(T_1)
and represent this choice with (1, v)
where v
is a value of type T_1
.
Product(ProductValue)
A structural product value.
Given a product type { N_0: T_0, N_1: T_1, ..., N_n: T_n }
where N_i
denotes a field / element name
and where T_i
denotes the type the field stores,
a product value stores a value v_i
of type T_i
for each field N_i
.
Array(ArrayValue)
A homogeneous array of AlgebraicValue
s.
The array has the type [AlgebraicType::Array(elem_ty)
].
The contained values are stored packed in a representation appropriate for their type.
See ArrayValue
for details on the representation.
Map(Box<MapValue>)
An ordered map value of key: AlgebraicValue
s mapped to value: AlgebraicValue
s.
Each key
must be of the same AlgebraicType
as all the others
and the same applies to each value
.
A map as a whole has the type [AlgebraicType::Map(key_ty, val_ty)
].
Maps are implemented internally as [BTreeMap<AlgebraicValue, AlgebraicValue>
].
This implies that key/values are ordered first by key and then value
as if they were a sorted slice [(key, value)]
.
This order is observable as maps are exposed both directly
and indirectly via Ord for
AlgebraicValue
.
The latter lets us observe that e.g., { a: 42 } < { b: 42 }
.
However, we cannot observe any difference between { a: 0, b: 0 }
and { b: 0, a: 0 }
,
as the natural order is used as opposed to insertion order.
Where insertion order is relevant,
a AlgebraicValue::Array
with (key, value)
pairs can be used instead.
We box the MapValue
to reduce size
and because we assume that map values will be uncommon.
Bool(bool)
A bool
value of type AlgebraicType::Bool
.
I8(i8)
An i8
value of type AlgebraicType::I8
.
U8(u8)
A u8
value of type AlgebraicType::U8
.
I16(i16)
An i16
value of type AlgebraicType::I16
.
U16(u16)
A u16
value of type AlgebraicType::U16
.
I32(i32)
An i32
value of type AlgebraicType::I32
.
U32(u32)
A u32
value of type AlgebraicType::U32
.
I64(i64)
An i64
value of type AlgebraicType::I64
.
U64(u64)
A u64
value of type AlgebraicType::U64
.
I128(Packed<i128>)
An i128
value of type AlgebraicType::I128
.
We box these up as they allow us to shrink AlgebraicValue
.
U128(Packed<u128>)
A u128
value of type AlgebraicType::U128
.
We box these up as they allow us to shrink AlgebraicValue
.
F32(F32)
A totally ordered F32
value of type AlgebraicType::F32
.
All floating point values defined in IEEE-754 are supported.
However, unlike the primitive f32
, a total order is established.
F64(F64)
A totally ordered F64
value of type AlgebraicType::F64
.
All floating point values defined in IEEE-754 are supported.
However, unlike the primitive f64
, a total order is established.
String(Box<str>)
A UTF-8 string value of type AlgebraicType::String
.
Uses Rust’s standard representation of strings.
Implementations§
source§impl AlgebraicValue
impl AlgebraicValue
sourcepub fn as_sum_mut(&mut self) -> Option<&mut SumValue>
pub fn as_sum_mut(&mut self) -> Option<&mut SumValue>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::Sum
, otherwise None
sourcepub fn as_sum(&self) -> Option<&SumValue>
pub fn as_sum(&self) -> Option<&SumValue>
Optionally returns references to the inner fields if this is a AlgebraicValue::Sum
, otherwise None
sourcepub fn into_sum(self) -> Result<SumValue, Self>
pub fn into_sum(self) -> Result<SumValue, Self>
Returns the inner fields if this is a AlgebraicValue::Sum
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_product(&self) -> bool
pub fn is_product(&self) -> bool
Returns true if this is a AlgebraicValue::Product
, otherwise false
sourcepub fn as_product_mut(&mut self) -> Option<&mut ProductValue>
pub fn as_product_mut(&mut self) -> Option<&mut ProductValue>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::Product
, otherwise None
sourcepub fn as_product(&self) -> Option<&ProductValue>
pub fn as_product(&self) -> Option<&ProductValue>
Optionally returns references to the inner fields if this is a AlgebraicValue::Product
, otherwise None
sourcepub fn into_product(self) -> Result<ProductValue, Self>
pub fn into_product(self) -> Result<ProductValue, Self>
Returns the inner fields if this is a AlgebraicValue::Product
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Returns true if this is a AlgebraicValue::Array
, otherwise false
sourcepub fn as_array_mut(&mut self) -> Option<&mut ArrayValue>
pub fn as_array_mut(&mut self) -> Option<&mut ArrayValue>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::Array
, otherwise None
sourcepub fn as_array(&self) -> Option<&ArrayValue>
pub fn as_array(&self) -> Option<&ArrayValue>
Optionally returns references to the inner fields if this is a AlgebraicValue::Array
, otherwise None
sourcepub fn into_array(self) -> Result<ArrayValue, Self>
pub fn into_array(self) -> Result<ArrayValue, Self>
Returns the inner fields if this is a AlgebraicValue::Array
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_map_mut(&mut self) -> Option<&mut Box<MapValue>>
pub fn as_map_mut(&mut self) -> Option<&mut Box<MapValue>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::Map
, otherwise None
sourcepub fn as_map(&self) -> Option<&Box<MapValue>>
pub fn as_map(&self) -> Option<&Box<MapValue>>
Optionally returns references to the inner fields if this is a AlgebraicValue::Map
, otherwise None
sourcepub fn into_map(self) -> Result<Box<MapValue>, Self>
pub fn into_map(self) -> Result<Box<MapValue>, Self>
Returns the inner fields if this is a AlgebraicValue::Map
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_bool_mut(&mut self) -> Option<&mut bool>
pub fn as_bool_mut(&mut self) -> Option<&mut bool>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::Bool
, otherwise None
sourcepub fn as_bool(&self) -> Option<&bool>
pub fn as_bool(&self) -> Option<&bool>
Optionally returns references to the inner fields if this is a AlgebraicValue::Bool
, otherwise None
sourcepub fn into_bool(self) -> Result<bool, Self>
pub fn into_bool(self) -> Result<bool, Self>
Returns the inner fields if this is a AlgebraicValue::Bool
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_i8_mut(&mut self) -> Option<&mut i8>
pub fn as_i8_mut(&mut self) -> Option<&mut i8>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::I8
, otherwise None
sourcepub fn as_i8(&self) -> Option<&i8>
pub fn as_i8(&self) -> Option<&i8>
Optionally returns references to the inner fields if this is a AlgebraicValue::I8
, otherwise None
sourcepub fn into_i8(self) -> Result<i8, Self>
pub fn into_i8(self) -> Result<i8, Self>
Returns the inner fields if this is a AlgebraicValue::I8
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_u8_mut(&mut self) -> Option<&mut u8>
pub fn as_u8_mut(&mut self) -> Option<&mut u8>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::U8
, otherwise None
sourcepub fn as_u8(&self) -> Option<&u8>
pub fn as_u8(&self) -> Option<&u8>
Optionally returns references to the inner fields if this is a AlgebraicValue::U8
, otherwise None
sourcepub fn into_u8(self) -> Result<u8, Self>
pub fn into_u8(self) -> Result<u8, Self>
Returns the inner fields if this is a AlgebraicValue::U8
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_i16_mut(&mut self) -> Option<&mut i16>
pub fn as_i16_mut(&mut self) -> Option<&mut i16>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::I16
, otherwise None
sourcepub fn as_i16(&self) -> Option<&i16>
pub fn as_i16(&self) -> Option<&i16>
Optionally returns references to the inner fields if this is a AlgebraicValue::I16
, otherwise None
sourcepub fn into_i16(self) -> Result<i16, Self>
pub fn into_i16(self) -> Result<i16, Self>
Returns the inner fields if this is a AlgebraicValue::I16
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_u16_mut(&mut self) -> Option<&mut u16>
pub fn as_u16_mut(&mut self) -> Option<&mut u16>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::U16
, otherwise None
sourcepub fn as_u16(&self) -> Option<&u16>
pub fn as_u16(&self) -> Option<&u16>
Optionally returns references to the inner fields if this is a AlgebraicValue::U16
, otherwise None
sourcepub fn into_u16(self) -> Result<u16, Self>
pub fn into_u16(self) -> Result<u16, Self>
Returns the inner fields if this is a AlgebraicValue::U16
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_i32_mut(&mut self) -> Option<&mut i32>
pub fn as_i32_mut(&mut self) -> Option<&mut i32>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::I32
, otherwise None
sourcepub fn as_i32(&self) -> Option<&i32>
pub fn as_i32(&self) -> Option<&i32>
Optionally returns references to the inner fields if this is a AlgebraicValue::I32
, otherwise None
sourcepub fn into_i32(self) -> Result<i32, Self>
pub fn into_i32(self) -> Result<i32, Self>
Returns the inner fields if this is a AlgebraicValue::I32
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_u32_mut(&mut self) -> Option<&mut u32>
pub fn as_u32_mut(&mut self) -> Option<&mut u32>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::U32
, otherwise None
sourcepub fn as_u32(&self) -> Option<&u32>
pub fn as_u32(&self) -> Option<&u32>
Optionally returns references to the inner fields if this is a AlgebraicValue::U32
, otherwise None
sourcepub fn into_u32(self) -> Result<u32, Self>
pub fn into_u32(self) -> Result<u32, Self>
Returns the inner fields if this is a AlgebraicValue::U32
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_i64_mut(&mut self) -> Option<&mut i64>
pub fn as_i64_mut(&mut self) -> Option<&mut i64>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::I64
, otherwise None
sourcepub fn as_i64(&self) -> Option<&i64>
pub fn as_i64(&self) -> Option<&i64>
Optionally returns references to the inner fields if this is a AlgebraicValue::I64
, otherwise None
sourcepub fn into_i64(self) -> Result<i64, Self>
pub fn into_i64(self) -> Result<i64, Self>
Returns the inner fields if this is a AlgebraicValue::I64
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_u64_mut(&mut self) -> Option<&mut u64>
pub fn as_u64_mut(&mut self) -> Option<&mut u64>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::U64
, otherwise None
sourcepub fn as_u64(&self) -> Option<&u64>
pub fn as_u64(&self) -> Option<&u64>
Optionally returns references to the inner fields if this is a AlgebraicValue::U64
, otherwise None
sourcepub fn into_u64(self) -> Result<u64, Self>
pub fn into_u64(self) -> Result<u64, Self>
Returns the inner fields if this is a AlgebraicValue::U64
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_i128_mut(&mut self) -> Option<&mut Packed<i128>>
pub fn as_i128_mut(&mut self) -> Option<&mut Packed<i128>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::I128
, otherwise None
sourcepub fn as_i128(&self) -> Option<&Packed<i128>>
pub fn as_i128(&self) -> Option<&Packed<i128>>
Optionally returns references to the inner fields if this is a AlgebraicValue::I128
, otherwise None
sourcepub fn into_i128(self) -> Result<Packed<i128>, Self>
pub fn into_i128(self) -> Result<Packed<i128>, Self>
Returns the inner fields if this is a AlgebraicValue::I128
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_u128_mut(&mut self) -> Option<&mut Packed<u128>>
pub fn as_u128_mut(&mut self) -> Option<&mut Packed<u128>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::U128
, otherwise None
sourcepub fn as_u128(&self) -> Option<&Packed<u128>>
pub fn as_u128(&self) -> Option<&Packed<u128>>
Optionally returns references to the inner fields if this is a AlgebraicValue::U128
, otherwise None
sourcepub fn into_u128(self) -> Result<Packed<u128>, Self>
pub fn into_u128(self) -> Result<Packed<u128>, Self>
Returns the inner fields if this is a AlgebraicValue::U128
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_f32_mut(&mut self) -> Option<&mut F32>
pub fn as_f32_mut(&mut self) -> Option<&mut F32>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::F32
, otherwise None
sourcepub fn as_f32(&self) -> Option<&F32>
pub fn as_f32(&self) -> Option<&F32>
Optionally returns references to the inner fields if this is a AlgebraicValue::F32
, otherwise None
sourcepub fn into_f32(self) -> Result<F32, Self>
pub fn into_f32(self) -> Result<F32, Self>
Returns the inner fields if this is a AlgebraicValue::F32
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_f64_mut(&mut self) -> Option<&mut F64>
pub fn as_f64_mut(&mut self) -> Option<&mut F64>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::F64
, otherwise None
sourcepub fn as_f64(&self) -> Option<&F64>
pub fn as_f64(&self) -> Option<&F64>
Optionally returns references to the inner fields if this is a AlgebraicValue::F64
, otherwise None
sourcepub fn into_f64(self) -> Result<F64, Self>
pub fn into_f64(self) -> Result<F64, Self>
Returns the inner fields if this is a AlgebraicValue::F64
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if this is a AlgebraicValue::String
, otherwise false
sourcepub fn as_string_mut(&mut self) -> Option<&mut Box<str>>
pub fn as_string_mut(&mut self) -> Option<&mut Box<str>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::String
, otherwise None
sourcepub fn as_string(&self) -> Option<&Box<str>>
pub fn as_string(&self) -> Option<&Box<str>>
Optionally returns references to the inner fields if this is a AlgebraicValue::String
, otherwise None
sourcepub fn into_string(self) -> Result<Box<str>, Self>
pub fn into_string(self) -> Result<Box<str>, Self>
Returns the inner fields if this is a AlgebraicValue::String
, otherwise returns back the enum in the Err
case of the result
source§impl AlgebraicValue
impl AlgebraicValue
sourcepub fn take(&mut self) -> Self
pub fn take(&mut self) -> Self
Extract the value and replace it with a dummy one that is cheap to make.
sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Interpret the value as a byte slice or None
if it isn’t a byte slice.
sourcepub fn unit() -> Self
pub fn unit() -> Self
The canonical unit value defined as the nullary product value ()
.
The type of UNIT
is ()
.
sourcepub const fn Bytes(v: Box<[u8]>) -> Self
pub const fn Bytes(v: Box<[u8]>) -> Self
Returns an AlgebraicValue
representing v: Box<[u8]>
.
sourcepub fn into_bytes(self) -> Result<Box<[u8]>, Self>
pub fn into_bytes(self) -> Result<Box<[u8]>, Self>
Converts self
into a byte string, if applicable.
sourcepub fn OptionSome(v: Self) -> Self
pub fn OptionSome(v: Self) -> Self
Returns an AlgebraicValue
for some: v
.
The some
variant is assigned the tag 0
.
sourcepub fn OptionNone() -> Self
pub fn OptionNone() -> Self
Returns an AlgebraicValue
for none
.
The none
variant is assigned the tag 1
.
sourcepub fn sum(tag: u8, value: Self) -> Self
pub fn sum(tag: u8, value: Self) -> Self
Returns an AlgebraicValue
representing a sum value with tag
and value
.
sourcepub fn enum_simple(tag: u8) -> Self
pub fn enum_simple(tag: u8) -> Self
Returns an AlgebraicValue
representing a sum value with tag
and empty AlgebraicValue::product, that is
valid for simple enums without payload.
sourcepub fn product(elements: impl Into<ProductValue>) -> Self
pub fn product(elements: impl Into<ProductValue>) -> Self
Returns an AlgebraicValue
representing a product value with the given elements
.
sourcepub fn map(map: MapValue) -> Self
pub fn map(map: MapValue) -> Self
Returns an AlgebraicValue
representing a map value defined by the given map
.
sourcepub fn type_of(&self) -> Option<AlgebraicType>
pub fn type_of(&self) -> Option<AlgebraicType>
Infer the AlgebraicType
of an AlgebraicValue
.
This function is partial
as type inference is not possible for AlgebraicValue
in the case of sums.
Thus the method only answers for the decidable subset.
§A note on sums
The type of a sum value must be a sum type and not a product type.
Suppose x.tag
is for the variant VarName(VarType)
.
Then VarType
is not the same type as { VarName(VarType) | r }
where r
represents a polymorphic variants component.
To assign this a correct type we either have to store the type with the value r alternatively, we must have polymorphic variants (see row polymorphism) and derive the correct variant name.
sourcepub fn is_numeric_zero(&self) -> bool
pub fn is_numeric_zero(&self) -> bool
Returns whether this value represents a numeric zero.
Can only be true where the type is numeric.
sourcepub fn from_sequence_value(ty: &AlgebraicType, sequence_value: i128) -> Self
pub fn from_sequence_value(ty: &AlgebraicType, sequence_value: i128) -> Self
Converts sequence_value
to an appropriate AlgebraicValue
based on ty
.
Truncates the sequence_value
to fit ty
.
Panics if ty
is not an integer type.
source§impl AlgebraicValue
impl AlgebraicValue
sourcepub fn decode<'a>(
ty: &<Self as Value>::Type,
bytes: &mut impl BufReader<'a>,
) -> Result<Self, DecodeError>
pub fn decode<'a>( ty: &<Self as Value>::Type, bytes: &mut impl BufReader<'a>, ) -> Result<Self, DecodeError>
Decode a value from bytes
typed at ty
.
sourcepub fn decode_smallvec<'a>(
ty: &<Self as Value>::Type,
bytes: &mut impl BufReader<'a>,
) -> Result<SmallVec<[Self; 1]>, DecodeError>
pub fn decode_smallvec<'a>( ty: &<Self as Value>::Type, bytes: &mut impl BufReader<'a>, ) -> Result<SmallVec<[Self; 1]>, DecodeError>
Decode a vector of values from bytes
with each value typed at ty
.
pub fn encode(&self, bytes: &mut impl BufWriter)
Trait Implementations§
source§impl Clone for AlgebraicValue
impl Clone for AlgebraicValue
source§fn clone(&self) -> AlgebraicValue
fn clone(&self) -> AlgebraicValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AlgebraicValue
impl Debug for AlgebraicValue
source§impl From<&[u8]> for AlgebraicValue
impl From<&[u8]> for AlgebraicValue
source§impl From<&str> for AlgebraicValue
impl From<&str> for AlgebraicValue
source§impl From<AlgebraicValue> for ProductValue
impl From<AlgebraicValue> for ProductValue
source§fn from(x: AlgebraicValue) -> Self
fn from(x: AlgebraicValue) -> Self
source§impl From<AlgebraicValue> for ValueDeserializer
impl From<AlgebraicValue> for ValueDeserializer
source§fn from(original: AlgebraicValue) -> ValueDeserializer
fn from(original: AlgebraicValue) -> ValueDeserializer
source§impl From<ArrayValue> for AlgebraicValue
impl From<ArrayValue> for AlgebraicValue
source§fn from(original: ArrayValue) -> AlgebraicValue
fn from(original: ArrayValue) -> AlgebraicValue
source§impl From<BTreeMap<AlgebraicValue, AlgebraicValue>> for AlgebraicValue
impl From<BTreeMap<AlgebraicValue, AlgebraicValue>> for AlgebraicValue
source§impl From<Box<BTreeMap<AlgebraicValue, AlgebraicValue>>> for AlgebraicValue
impl From<Box<BTreeMap<AlgebraicValue, AlgebraicValue>>> for AlgebraicValue
source§impl From<ColId> for AlgebraicValue
impl From<ColId> for AlgebraicValue
source§impl From<ConstrainedFloat<f32, UnitConstraint<f32>>> for AlgebraicValue
impl From<ConstrainedFloat<f32, UnitConstraint<f32>>> for AlgebraicValue
source§fn from(original: F32) -> AlgebraicValue
fn from(original: F32) -> AlgebraicValue
source§impl From<ConstrainedFloat<f64, UnitConstraint<f64>>> for AlgebraicValue
impl From<ConstrainedFloat<f64, UnitConstraint<f64>>> for AlgebraicValue
source§fn from(original: F64) -> AlgebraicValue
fn from(original: F64) -> AlgebraicValue
source§impl From<ConstraintId> for AlgebraicValue
impl From<ConstraintId> for AlgebraicValue
source§fn from(value: ConstraintId) -> Self
fn from(value: ConstraintId) -> Self
source§impl From<IndexId> for AlgebraicValue
impl From<IndexId> for AlgebraicValue
source§impl<T: Into<AlgebraicValue>> From<Option<T>> for AlgebraicValue
impl<T: Into<AlgebraicValue>> From<Option<T>> for AlgebraicValue
source§impl From<ProductValue> for AlgebraicValue
impl From<ProductValue> for AlgebraicValue
source§fn from(original: ProductValue) -> AlgebraicValue
fn from(original: ProductValue) -> AlgebraicValue
source§impl From<SequenceId> for AlgebraicValue
impl From<SequenceId> for AlgebraicValue
source§fn from(value: SequenceId) -> Self
fn from(value: SequenceId) -> Self
source§impl From<SumValue> for AlgebraicValue
impl From<SumValue> for AlgebraicValue
source§fn from(original: SumValue) -> AlgebraicValue
fn from(original: SumValue) -> AlgebraicValue
source§impl From<TableId> for AlgebraicValue
impl From<TableId> for AlgebraicValue
source§impl From<bool> for AlgebraicValue
impl From<bool> for AlgebraicValue
source§fn from(original: bool) -> AlgebraicValue
fn from(original: bool) -> AlgebraicValue
source§impl From<f32> for AlgebraicValue
impl From<f32> for AlgebraicValue
source§impl From<f64> for AlgebraicValue
impl From<f64> for AlgebraicValue
source§impl From<i128> for AlgebraicValue
impl From<i128> for AlgebraicValue
source§impl From<i16> for AlgebraicValue
impl From<i16> for AlgebraicValue
source§fn from(original: i16) -> AlgebraicValue
fn from(original: i16) -> AlgebraicValue
source§impl From<i32> for AlgebraicValue
impl From<i32> for AlgebraicValue
source§fn from(original: i32) -> AlgebraicValue
fn from(original: i32) -> AlgebraicValue
source§impl From<i64> for AlgebraicValue
impl From<i64> for AlgebraicValue
source§fn from(original: i64) -> AlgebraicValue
fn from(original: i64) -> AlgebraicValue
source§impl From<i8> for AlgebraicValue
impl From<i8> for AlgebraicValue
source§fn from(original: i8) -> AlgebraicValue
fn from(original: i8) -> AlgebraicValue
source§impl From<u128> for AlgebraicValue
impl From<u128> for AlgebraicValue
source§impl From<u16> for AlgebraicValue
impl From<u16> for AlgebraicValue
source§fn from(original: u16) -> AlgebraicValue
fn from(original: u16) -> AlgebraicValue
source§impl From<u32> for AlgebraicValue
impl From<u32> for AlgebraicValue
source§fn from(original: u32) -> AlgebraicValue
fn from(original: u32) -> AlgebraicValue
source§impl From<u64> for AlgebraicValue
impl From<u64> for AlgebraicValue
source§fn from(original: u64) -> AlgebraicValue
fn from(original: u64) -> AlgebraicValue
source§impl From<u8> for AlgebraicValue
impl From<u8> for AlgebraicValue
source§fn from(original: u8) -> AlgebraicValue
fn from(original: u8) -> AlgebraicValue
source§impl FromIterator<AlgebraicValue> for ProductValue
impl FromIterator<AlgebraicValue> for ProductValue
source§fn from_iter<T: IntoIterator<Item = AlgebraicValue>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = AlgebraicValue>>(iter: T) -> Self
source§impl Hash for AlgebraicValue
impl Hash for AlgebraicValue
The hash function for an AlgebraicValue
only hashes its domain types
and avoids length prefixing for product values.
This avoids the hashing Discriminant<AlgebraicValue>
which is OK as a table column will only ever have the same type (and so the same discriminant).
source§impl Ord for AlgebraicValue
impl Ord for AlgebraicValue
source§fn cmp(&self, other: &AlgebraicValue) -> Ordering
fn cmp(&self, other: &AlgebraicValue) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for AlgebraicValue
impl PartialEq for AlgebraicValue
source§impl PartialOrd for AlgebraicValue
impl PartialOrd for AlgebraicValue
source§impl RangeBounds<AlgebraicValue> for &AlgebraicValue
impl RangeBounds<AlgebraicValue> for &AlgebraicValue
An AlgebraicValue can be interpreted as a range containing a only the value itself. This is useful for BTrees where single key scans are still viewed range scans.
source§impl RangeBounds<AlgebraicValue> for AlgebraicValue
impl RangeBounds<AlgebraicValue> for AlgebraicValue
source§impl Serialize for AlgebraicValue
impl Serialize for AlgebraicValue
source§impl Value for AlgebraicValue
impl Value for AlgebraicValue
source§type Type = AlgebraicType
type Type = AlgebraicType
impl Eq for AlgebraicValue
impl StructuralPartialEq for AlgebraicValue
Auto Trait Implementations§
impl Freeze for AlgebraicValue
impl RefUnwindSafe for AlgebraicValue
impl Send for AlgebraicValue
impl Sync for AlgebraicValue
impl Unpin for AlgebraicValue
impl UnwindSafe for AlgebraicValue
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moresource§impl<T> Satn for T
impl<T> Satn for T
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
f
.source§fn fmt_psql(&self, f: &mut Formatter<'_>, ty: &ProductType) -> Result
fn fmt_psql(&self, f: &mut Formatter<'_>, ty: &ProductType) -> Result
f
.source§fn to_satn(&self) -> String
fn to_satn(&self) -> String
String
.source§fn to_satn_pretty(&self) -> String
fn to_satn_pretty(&self) -> String
String
.