pub enum AlgebraicValue {
Show 21 variants
Min,
Sum(SumValue),
Product(ProductValue),
Array(ArrayValue),
Bool(bool),
I8(i8),
U8(u8),
I16(i16),
U16(u16),
I32(i32),
U32(u32),
I64(i64),
U64(u64),
I128(Packed<i128>),
U128(Packed<u128>),
I256(Box<I256>),
U256(Box<U256>),
F32(ConstrainedFloat<f32, UnitConstraint<f32>>),
F64(ConstrainedFloat<f64, UnitConstraint<f64>>),
String(Box<str>),
Max,
}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§
Min
The minimum value in the total ordering. Cannot be serialized and only exists to facilitate range index scans. This variant must always be first.
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 AlgebraicValues.
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.
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 pack these to shrink AlgebraicValue.
U128(Packed<u128>)
A u128 value of type AlgebraicType::U128.
We pack these to to shrink AlgebraicValue.
I256(Box<I256>)
An i256 value of type AlgebraicType::I256.
We box these up to shrink AlgebraicValue.
U256(Box<U256>)
A u256 value of type AlgebraicType::U256.
We pack these to shrink AlgebraicValue.
F32(ConstrainedFloat<f32, UnitConstraint<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(ConstrainedFloat<f64, UnitConstraint<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.
Max
The maximum value in the total ordering. Cannot be serialized and only exists to facilitate range index scans. This variant must always be last.
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, AlgebraicValue>
pub fn into_sum(self) -> Result<SumValue, AlgebraicValue>
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, AlgebraicValue>
pub fn into_product(self) -> Result<ProductValue, AlgebraicValue>
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, AlgebraicValue>
pub fn into_array(self) -> Result<ArrayValue, AlgebraicValue>
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_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, AlgebraicValue>
pub fn into_bool(self) -> Result<bool, AlgebraicValue>
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, AlgebraicValue>
pub fn into_i8(self) -> Result<i8, AlgebraicValue>
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, AlgebraicValue>
pub fn into_u8(self) -> Result<u8, AlgebraicValue>
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, AlgebraicValue>
pub fn into_i16(self) -> Result<i16, AlgebraicValue>
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, AlgebraicValue>
pub fn into_u16(self) -> Result<u16, AlgebraicValue>
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, AlgebraicValue>
pub fn into_i32(self) -> Result<i32, AlgebraicValue>
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, AlgebraicValue>
pub fn into_u32(self) -> Result<u32, AlgebraicValue>
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, AlgebraicValue>
pub fn into_i64(self) -> Result<i64, AlgebraicValue>
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, AlgebraicValue>
pub fn into_u64(self) -> Result<u64, AlgebraicValue>
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>, AlgebraicValue>
pub fn into_i128(self) -> Result<Packed<i128>, AlgebraicValue>
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>, AlgebraicValue>
pub fn into_u128(self) -> Result<Packed<u128>, AlgebraicValue>
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_i256_mut(&mut self) -> Option<&mut Box<I256>>
pub fn as_i256_mut(&mut self) -> Option<&mut Box<I256>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::I256, otherwise None
Sourcepub fn as_i256(&self) -> Option<&Box<I256>>
pub fn as_i256(&self) -> Option<&Box<I256>>
Optionally returns references to the inner fields if this is a AlgebraicValue::I256, otherwise None
Sourcepub fn into_i256(self) -> Result<Box<I256>, AlgebraicValue>
pub fn into_i256(self) -> Result<Box<I256>, AlgebraicValue>
Returns the inner fields if this is a AlgebraicValue::I256, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_u256_mut(&mut self) -> Option<&mut Box<U256>>
pub fn as_u256_mut(&mut self) -> Option<&mut Box<U256>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::U256, otherwise None
Sourcepub fn as_u256(&self) -> Option<&Box<U256>>
pub fn as_u256(&self) -> Option<&Box<U256>>
Optionally returns references to the inner fields if this is a AlgebraicValue::U256, otherwise None
Sourcepub fn into_u256(self) -> Result<Box<U256>, AlgebraicValue>
pub fn into_u256(self) -> Result<Box<U256>, AlgebraicValue>
Returns the inner fields if this is a AlgebraicValue::U256, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_f32_mut(
&mut self,
) -> Option<&mut ConstrainedFloat<f32, UnitConstraint<f32>>>
pub fn as_f32_mut( &mut self, ) -> Option<&mut ConstrainedFloat<f32, UnitConstraint<f32>>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::F32, otherwise None
Sourcepub fn as_f32(&self) -> Option<&ConstrainedFloat<f32, UnitConstraint<f32>>>
pub fn as_f32(&self) -> Option<&ConstrainedFloat<f32, UnitConstraint<f32>>>
Optionally returns references to the inner fields if this is a AlgebraicValue::F32, otherwise None
Sourcepub fn into_f32(
self,
) -> Result<ConstrainedFloat<f32, UnitConstraint<f32>>, AlgebraicValue>
pub fn into_f32( self, ) -> Result<ConstrainedFloat<f32, UnitConstraint<f32>>, AlgebraicValue>
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 ConstrainedFloat<f64, UnitConstraint<f64>>>
pub fn as_f64_mut( &mut self, ) -> Option<&mut ConstrainedFloat<f64, UnitConstraint<f64>>>
Optionally returns mutable references to the inner fields if this is a AlgebraicValue::F64, otherwise None
Sourcepub fn as_f64(&self) -> Option<&ConstrainedFloat<f64, UnitConstraint<f64>>>
pub fn as_f64(&self) -> Option<&ConstrainedFloat<f64, UnitConstraint<f64>>>
Optionally returns references to the inner fields if this is a AlgebraicValue::F64, otherwise None
Sourcepub fn into_f64(
self,
) -> Result<ConstrainedFloat<f64, UnitConstraint<f64>>, AlgebraicValue>
pub fn into_f64( self, ) -> Result<ConstrainedFloat<f64, UnitConstraint<f64>>, AlgebraicValue>
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>, AlgebraicValue>
pub fn into_string(self) -> Result<Box<str>, AlgebraicValue>
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) -> AlgebraicValue
pub fn take(&mut self) -> AlgebraicValue
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() -> AlgebraicValue
pub fn unit() -> AlgebraicValue
The canonical unit value defined as the nullary product value ().
The type of UNIT is ().
Sourcepub const fn Bytes(v: Box<[u8]>) -> AlgebraicValue
pub const fn Bytes(v: Box<[u8]>) -> AlgebraicValue
Returns an AlgebraicValue representing v: Box<[u8]>.
Sourcepub fn into_bytes(self) -> Result<Box<[u8]>, AlgebraicValue>
pub fn into_bytes(self) -> Result<Box<[u8]>, AlgebraicValue>
Converts self into a byte string, if applicable.
Sourcepub fn into_option(self) -> Result<Option<AlgebraicValue>, AlgebraicValue>
pub fn into_option(self) -> Result<Option<AlgebraicValue>, AlgebraicValue>
Converts self into an Option<AlgebraicValue>, if applicable.
Sourcepub fn OptionSome(v: AlgebraicValue) -> AlgebraicValue
pub fn OptionSome(v: AlgebraicValue) -> AlgebraicValue
Returns an AlgebraicValue for some: v.
The some variant is assigned the tag 0.
Sourcepub fn OptionNone() -> AlgebraicValue
pub fn OptionNone() -> AlgebraicValue
Returns an AlgebraicValue for none.
The none variant is assigned the tag 1.
Sourcepub fn sum(tag: u8, value: AlgebraicValue) -> AlgebraicValue
pub fn sum(tag: u8, value: AlgebraicValue) -> AlgebraicValue
Returns an AlgebraicValue representing a sum value with tag and value.
Sourcepub fn enum_simple(tag: u8) -> AlgebraicValue
pub fn enum_simple(tag: u8) -> AlgebraicValue
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>) -> AlgebraicValue
pub fn product(elements: impl Into<ProductValue>) -> AlgebraicValue
Returns an AlgebraicValue representing a product value with the given elements.
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.
Source§impl AlgebraicValue
impl AlgebraicValue
Sourcepub fn decode<'a>(
ty: &<AlgebraicValue as Value>::Type,
bytes: &mut impl BufReader<'a>,
) -> Result<AlgebraicValue, DecodeError>
pub fn decode<'a>( ty: &<AlgebraicValue as Value>::Type, bytes: &mut impl BufReader<'a>, ) -> Result<AlgebraicValue, DecodeError>
Decode a value from bytes typed at ty.
Sourcepub fn decode_smallvec<'a>(
ty: &<AlgebraicValue as Value>::Type,
bytes: &mut impl BufReader<'a>,
) -> Result<SmallVec<[AlgebraicValue; 1]>, DecodeError>
pub fn decode_smallvec<'a>( ty: &<AlgebraicValue as Value>::Type, bytes: &mut impl BufReader<'a>, ) -> Result<SmallVec<[AlgebraicValue; 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§fn from(x: &[u8]) -> AlgebraicValue
fn from(x: &[u8]) -> AlgebraicValue
Source§impl From<&str> for AlgebraicValue
impl From<&str> for AlgebraicValue
Source§fn from(x: &str) -> AlgebraicValue
fn from(x: &str) -> AlgebraicValue
Source§impl From<()> for AlgebraicValue
impl From<()> for AlgebraicValue
Source§fn from(_: ()) -> AlgebraicValue
fn from(_: ()) -> AlgebraicValue
Source§impl From<AlgebraicValue> for ProductValue
impl From<AlgebraicValue> for ProductValue
Source§fn from(x: AlgebraicValue) -> ProductValue
fn from(x: AlgebraicValue) -> ProductValue
Source§impl From<ArgId> for AlgebraicValue
impl From<ArgId> for AlgebraicValue
Source§fn from(value: ArgId) -> AlgebraicValue
fn from(value: ArgId) -> AlgebraicValue
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<ColId> for AlgebraicValue
impl From<ColId> for AlgebraicValue
Source§fn from(value: ColId) -> AlgebraicValue
fn from(value: ColId) -> AlgebraicValue
Source§impl From<ConnectionId> for AlgebraicValue
impl From<ConnectionId> for AlgebraicValue
Source§fn from(value: ConnectionId) -> Self
fn from(value: ConnectionId) -> Self
Source§impl From<ConstrainedFloat<f32, UnitConstraint<f32>>> for AlgebraicValue
impl From<ConstrainedFloat<f32, UnitConstraint<f32>>> for AlgebraicValue
Source§fn from(original: ConstrainedFloat<f32, UnitConstraint<f32>>) -> AlgebraicValue
fn from(original: ConstrainedFloat<f32, UnitConstraint<f32>>) -> AlgebraicValue
Source§impl From<ConstrainedFloat<f64, UnitConstraint<f64>>> for AlgebraicValue
impl From<ConstrainedFloat<f64, UnitConstraint<f64>>> for AlgebraicValue
Source§fn from(original: ConstrainedFloat<f64, UnitConstraint<f64>>) -> AlgebraicValue
fn from(original: ConstrainedFloat<f64, UnitConstraint<f64>>) -> AlgebraicValue
Source§impl From<ConstraintId> for AlgebraicValue
impl From<ConstraintId> for AlgebraicValue
Source§fn from(value: ConstraintId) -> AlgebraicValue
fn from(value: ConstraintId) -> AlgebraicValue
Source§impl From<I256> for AlgebraicValue
impl From<I256> for AlgebraicValue
Source§fn from(x: I256) -> AlgebraicValue
fn from(x: I256) -> AlgebraicValue
Source§impl From<Identity> for AlgebraicValue
impl From<Identity> for AlgebraicValue
Source§impl From<IndexId> for AlgebraicValue
impl From<IndexId> for AlgebraicValue
Source§fn from(value: IndexId) -> AlgebraicValue
fn from(value: IndexId) -> AlgebraicValue
Source§impl<T> From<Option<T>> for AlgebraicValuewhere
T: Into<AlgebraicValue>,
impl<T> From<Option<T>> for AlgebraicValuewhere
T: Into<AlgebraicValue>,
Source§fn from(value: Option<T>) -> AlgebraicValue
fn from(value: Option<T>) -> 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<ScheduleId> for AlgebraicValue
impl From<ScheduleId> for AlgebraicValue
Source§fn from(value: ScheduleId) -> AlgebraicValue
fn from(value: ScheduleId) -> AlgebraicValue
Source§impl From<SequenceId> for AlgebraicValue
impl From<SequenceId> for AlgebraicValue
Source§fn from(value: SequenceId) -> AlgebraicValue
fn from(value: SequenceId) -> AlgebraicValue
Source§impl From<StVarValue> for AlgebraicValue
impl From<StVarValue> for AlgebraicValue
Source§fn from(value: StVarValue) -> Self
fn from(value: StVarValue) -> Self
Source§impl From<String> for AlgebraicValue
impl From<String> for AlgebraicValue
Source§fn from(x: String) -> AlgebraicValue
fn from(x: String) -> AlgebraicValue
Source§impl From<SumTag> for AlgebraicValue
impl From<SumTag> for AlgebraicValue
Source§fn from(x: SumTag) -> AlgebraicValue
fn from(x: SumTag) -> AlgebraicValue
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§fn from(value: TableId) -> AlgebraicValue
fn from(value: TableId) -> AlgebraicValue
Source§impl From<TimeDuration> for AlgebraicValue
impl From<TimeDuration> for AlgebraicValue
Source§fn from(value: TimeDuration) -> AlgebraicValue
fn from(value: TimeDuration) -> AlgebraicValue
Source§impl From<Timestamp> for AlgebraicValue
impl From<Timestamp> for AlgebraicValue
Source§fn from(value: Timestamp) -> AlgebraicValue
fn from(value: Timestamp) -> AlgebraicValue
Source§impl From<U256> for AlgebraicValue
impl From<U256> for AlgebraicValue
Source§fn from(x: U256) -> AlgebraicValue
fn from(x: U256) -> AlgebraicValue
Source§impl From<ViewId> for AlgebraicValue
impl From<ViewId> for AlgebraicValue
Source§fn from(value: ViewId) -> AlgebraicValue
fn from(value: ViewId) -> 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§fn from(x: f32) -> AlgebraicValue
fn from(x: f32) -> AlgebraicValue
Source§impl From<f64> for AlgebraicValue
impl From<f64> for AlgebraicValue
Source§fn from(x: f64) -> AlgebraicValue
fn from(x: f64) -> AlgebraicValue
Source§impl From<i128> for AlgebraicValue
impl From<i128> for AlgebraicValue
Source§fn from(x: i128) -> AlgebraicValue
fn from(x: i128) -> 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§fn from(x: u128) -> AlgebraicValue
fn from(x: u128) -> 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>(iter: T) -> ProductValuewhere
T: IntoIterator<Item = AlgebraicValue>,
fn from_iter<T>(iter: T) -> ProductValuewhere
T: IntoIterator<Item = AlgebraicValue>,
Source§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).
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
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.
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§fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
self in the data format of S using the provided serializer.Source§impl Serialize for AlgebraicValue
impl Serialize for AlgebraicValue
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl SizeOf for AlgebraicValue
impl SizeOf for AlgebraicValue
Source§fn size_of(&self) -> usize
fn size_of(&self) -> usize
Source§impl TryFrom<AlgebraicValue> for ScheduleAt
impl TryFrom<AlgebraicValue> for ScheduleAt
Source§type Error = ValueDeserializeError
type Error = ValueDeserializeError
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§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<(), Error>
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
f.Source§fn fmt_psql(
&self,
f: &mut Formatter<'_>,
ty: &PsqlType<'_>,
) -> Result<(), Error>
fn fmt_psql( &self, f: &mut Formatter<'_>, ty: &PsqlType<'_>, ) -> Result<(), Error>
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.