pub enum CoreValue {
Show 14 variants
Null,
Boolean(Boolean),
Integer(Integer),
TypedInteger(TypedInteger),
Decimal(Decimal),
TypedDecimal(TypedDecimal),
Text(Text),
Endpoint(Endpoint),
List(List),
Map(Map),
Type(Type),
NominalTypeDefinition(NominalTypeDefinition),
Callable(Callable),
Range(Range),
}Variants§
Null
Boolean(Boolean)
Integer(Integer)
TypedInteger(TypedInteger)
Decimal(Decimal)
TypedDecimal(TypedDecimal)
Text(Text)
Endpoint(Endpoint)
List(List)
Map(Map)
Type(Type)
NominalTypeDefinition(NominalTypeDefinition)
Callable(Callable)
Range(Range)
Implementations§
Source§impl CoreValue
impl CoreValue
pub fn new<T>(value: T) -> CoreValue
Sourcepub fn is_collection_value(&self) -> bool
pub fn is_collection_value(&self) -> bool
Check if the CoreValue is a combined value type (List, Map) that contains inner ValueContainers.
Sourcepub fn default_core_type(&self) -> CoreLibTypeId
pub fn default_core_type(&self) -> CoreLibTypeId
Get the default type of the CoreValue type definition. This method uses the CoreLibPointerId to retrieve the corresponding type reference from the core library. For example, a CoreValue::TypedInteger(i32) will return the type ref integer/i32
Sourcepub fn try_as<'a, T: 'a>(&'a self) -> Option<&'a T>
pub fn try_as<'a, T: 'a>(&'a self) -> Option<&'a T>
Tries to get a borrow of the current value as the specified type. Does not perform any type conversion.
pub fn try_as_mut<'a, T: 'a>(&'a mut self) -> Option<&'a mut T>
Sourcepub fn try_into_value<T>(self) -> Option<T>
pub fn try_into_value<T>(self) -> Option<T>
Tries to convert the current value into the specific specified type. Does not perform any type conversion.
Sourcepub fn cast_to_text(&self) -> Text
pub fn cast_to_text(&self) -> Text
pub fn cast_to_bool(&self) -> Option<Boolean>
pub fn cast_to_decimal(&self) -> Option<Decimal>
pub fn cast_to_typed_decimal( &self, variant: DecimalTypeVariant, ) -> Option<TypedDecimal>
pub fn _cast_to_integer_internal(&self) -> Option<TypedInteger>
pub fn cast_to_integer(&self) -> Option<Integer>
pub fn cast_to_typed_integer( &self, variant: IntegerTypeVariant, ) -> Option<TypedInteger>
pub fn cast_to_endpoint(&self) -> Option<Endpoint>
Trait Implementations§
Source§impl AddAssign for CoreValue
impl AddAssign for CoreValue
Source§fn add_assign(&mut self, rhs: CoreValue)
fn add_assign(&mut self, rhs: CoreValue)
Performs the
+= operation. Read moreSource§impl<'a> ChildIterator<'a> for CoreValue
impl<'a> ChildIterator<'a> for CoreValue
fn iter_children(&self) -> impl Iterator<Item = &ValueContainer>
Source§impl DatexProxyTypes for CoreValue
impl DatexProxyTypes for CoreValue
fn datex_type(_memory: &mut SharedReferencesCache) -> Type
impl DatexValueProxy for CoreValue
Source§impl DatexValueProxyDeserialize for CoreValue
impl DatexValueProxyDeserialize for CoreValue
fn try_from_value(value: Value) -> Result<Self, TryFromDatexValueError>
fn try_from_map_property( value: Result<Value, KeyNotFoundError>, ) -> Result<Self, TryFromDatexValueError>
Source§impl DatexValueProxySerialize for CoreValue
impl DatexValueProxySerialize for CoreValue
fn try_to_value(self) -> Result<Value, TryToDatexValueError>
Source§impl<'de> Deserialize<'de> for CoreValue
impl<'de> Deserialize<'de> for CoreValue
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CoreValue
Source§impl From<&CoreValue> for CoreLibTypeId
impl From<&CoreValue> for CoreLibTypeId
Source§impl From<NominalTypeDefinition> for CoreValue
impl From<NominalTypeDefinition> for CoreValue
Source§fn from(value: NominalTypeDefinition) -> Self
fn from(value: NominalTypeDefinition) -> Self
Converts to this type from the input type.
Source§impl From<TypedDecimal> for CoreValue
impl From<TypedDecimal> for CoreValue
Source§fn from(value: TypedDecimal) -> Self
fn from(value: TypedDecimal) -> Self
Converts to this type from the input type.
Source§impl From<TypedInteger> for CoreValue
impl From<TypedInteger> for CoreValue
Source§fn from(value: TypedInteger) -> Self
fn from(value: TypedInteger) -> Self
Converts to this type from the input type.
Source§impl<T> FromIterator<T> for CoreValuewhere
T: Into<ValueContainer>,
impl<T> FromIterator<T> for CoreValuewhere
T: Into<ValueContainer>,
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl StructuralEq for CoreValue
impl StructuralEq for CoreValue
Source§fn structural_eq(&self, other: &Self) -> bool
fn structural_eq(&self, other: &Self) -> bool
Check if two values are equal, ignoring the type.
impl StructuralPartialEq for CoreValue
Source§impl<'a> TryFrom<&'a CoreValue> for &'a TypedInteger
impl<'a> TryFrom<&'a CoreValue> for &'a TypedInteger
Source§impl<'a> TryFrom<&'a CoreValue> for &'a TypedDecimal
impl<'a> TryFrom<&'a CoreValue> for &'a TypedDecimal
Source§impl<'a> TryFrom<&'a CoreValue> for &'a NominalTypeDefinition
impl<'a> TryFrom<&'a CoreValue> for &'a NominalTypeDefinition
Source§impl TryFrom<CoreValue> for TypedInteger
impl TryFrom<CoreValue> for TypedInteger
Source§impl TryFrom<CoreValue> for TypedDecimal
impl TryFrom<CoreValue> for TypedDecimal
Source§impl TryFrom<CoreValue> for NominalTypeDefinition
impl TryFrom<CoreValue> for NominalTypeDefinition
Auto Trait Implementations§
impl !RefUnwindSafe for CoreValue
impl !Send for CoreValue
impl !Sync for CoreValue
impl !UnwindSafe for CoreValue
impl Freeze for CoreValue
impl Unpin for CoreValue
impl UnsafeUnpin for CoreValue
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DatexValueContainerProxy for Twhere
T: DatexValueProxy,
Source§impl<T> DatexValueContainerProxyDeserialize for Twhere
T: DatexValueProxyDeserialize,
impl<T> DatexValueContainerProxyDeserialize for Twhere
T: DatexValueProxyDeserialize,
fn try_from_value_container( value: ValueContainer, ) -> Result<T, TryFromDatexValueError>
fn try_from_map_property( value: Result<ValueContainer, KeyNotFoundError>, ) -> Result<T, TryFromDatexValueError>
Source§fn try_from_bytes(
dxb: Vec<u8>,
runtime: &Runtime,
) -> Result<Self, DeserializationError>
fn try_from_bytes( dxb: Vec<u8>, runtime: &Runtime, ) -> Result<Self, DeserializationError>
Deserialize a value of type T from a byte slice containing DXB data
Source§impl<T> DatexValueContainerProxyInfallibleSerialize for Twhere
T: DatexValueProxyInfallibleSerialize,
impl<T> DatexValueContainerProxyInfallibleSerialize for Twhere
T: DatexValueProxyInfallibleSerialize,
fn to_value_container(self) -> ValueContainer
Source§impl<T> DatexValueContainerProxySerialize for Twhere
T: DatexValueProxySerialize,
impl<T> DatexValueContainerProxySerialize for Twhere
T: DatexValueProxySerialize,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
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 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>
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 moreSource§impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
Source§fn is_subset_of(&self, other: &U) -> bool
fn is_subset_of(&self, other: &U) -> bool
Returns whether self is a subset of type