pub enum BuiltinType {
}
Expand description
Represents the built-in types in SATS.
Some of these types are nominal in our otherwise structural type system.
Variants§
Bool
The bool type. Values BuiltinValue::Bool(b)
will have this type.
I8
The I8
type. Values BuiltinValue::I8(v)
will have this type.
U8
The U8
type. Values BuiltinValue::U8(v)
will have this type.
I16
The I16
type. Values BuiltinValue::I16(v)
will have this type.
U16
The U16
type. Values BuiltinValue::U16(v)
will have this type.
I32
The I32
type. Values BuiltinValue::I32(v)
will have this type.
U32
The U32
type. Values BuiltinValue::U32(v)
will have this type.
I64
The I64
type. Values BuiltinValue::I64(v)
will have this type.
U64
The U64
type. Values BuiltinValue::U64(v)
will have this type.
I128
The I128
type. Values BuiltinValue::I128(v)
will have this type.
U128
The U128
type. Values BuiltinValue::U128(v)
will have this type.
F32
The F32
type. Values BuiltinValue::F32(v)
will have this type.
F64
The F64
type. Values BuiltinValue::F64(v)
will have this type.
String
The UTF-8 encoded String
type.
Values BuiltinValue::String(s)
will have this type.
This type exists for convenience and because it is easy to just use Rust’s String
(UTF-8)
as opposed to rolling your own equivalent byte-array based UTF-8 encoding.
Array(ArrayType)
The type of array values where elements are of a base type elem_ty
.
Values BuiltinValue::Array(array)
will have this type.
Map(Box<MapType>)
The type of map values consisting of a key type key_ty
and value ty
.
Values BuiltinValue::Map(map)
will have this type.
The order of entries in a map value is observable.
Implementations§
source§impl BuiltinType
impl BuiltinType
sourcepub fn as_array_mut(&mut self) -> Option<&mut ArrayType>
pub fn as_array_mut(&mut self) -> Option<&mut ArrayType>
Optionally returns mutable references to the inner fields if this is a BuiltinType::Array
, otherwise None
sourcepub fn as_array(&self) -> Option<&ArrayType>
pub fn as_array(&self) -> Option<&ArrayType>
Optionally returns references to the inner fields if this is a BuiltinType::Array
, otherwise None
sourcepub fn into_array(self) -> Result<ArrayType, Self>
pub fn into_array(self) -> Result<ArrayType, Self>
Returns the inner fields if this is a BuiltinType::Array
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_map_mut(&mut self) -> Option<&mut Box<MapType>>
pub fn as_map_mut(&mut self) -> Option<&mut Box<MapType>>
Optionally returns mutable references to the inner fields if this is a BuiltinType::Map
, otherwise None
source§impl BuiltinType
impl BuiltinType
pub fn as_value(&self) -> AlgebraicValue
pub fn from_value( value: &AlgebraicValue ) -> Result<BuiltinType, ValueDeserializeError>
Trait Implementations§
source§impl Clone for BuiltinType
impl Clone for BuiltinType
source§fn clone(&self) -> BuiltinType
fn clone(&self) -> BuiltinType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BuiltinType
impl Debug for BuiltinType
source§impl<'de> Deserialize<'de> for BuiltinType
impl<'de> Deserialize<'de> for BuiltinType
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
deserializer
.source§impl From<BuiltinType> for AlgebraicType
impl From<BuiltinType> for AlgebraicType
source§fn from(original: BuiltinType) -> AlgebraicType
fn from(original: BuiltinType) -> AlgebraicType
source§impl Hash for BuiltinType
impl Hash for BuiltinType
source§impl MetaType for BuiltinType
impl MetaType for BuiltinType
source§fn meta_type() -> AlgebraicType
fn meta_type() -> AlgebraicType
AlgebraicType
.source§impl Ord for BuiltinType
impl Ord for BuiltinType
source§fn cmp(&self, other: &BuiltinType) -> Ordering
fn cmp(&self, other: &BuiltinType) -> 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 BuiltinType
impl PartialEq for BuiltinType
source§fn eq(&self, other: &BuiltinType) -> bool
fn eq(&self, other: &BuiltinType) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for BuiltinType
impl PartialOrd for BuiltinType
source§fn partial_cmp(&self, other: &BuiltinType) -> Option<Ordering>
fn partial_cmp(&self, other: &BuiltinType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for BuiltinType
impl Serialize for BuiltinType
impl Eq for BuiltinType
impl StructuralPartialEq for BuiltinType
Auto Trait Implementations§
impl Freeze for BuiltinType
impl RefUnwindSafe for BuiltinType
impl Send for BuiltinType
impl Sync for BuiltinType
impl Unpin for BuiltinType
impl UnwindSafe for BuiltinType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> Pointable for T
impl<T> Pointable for T
source§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<'_>) -> Result
fn fmt_psql(&self, f: &mut Formatter<'_>) -> 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
.