pub enum CoreValue {
Show 19 variants
Uninitialized,
Null,
Boolean(Boolean),
Integer(Integer),
TypedInteger(TypedInteger),
Decimal(Decimal),
TypedDecimal(TypedDecimal),
Text(Text),
Endpoint(Endpoint),
List(List),
Map(Map),
Type(Type),
EntityTypeDefinition(EntityTypeDefinition),
Callable(Callable),
Range(Range),
Instant(Instant),
Sender(ValueContainerSender),
Receiver(ValueContainerReceiver),
Box(Box<ValueContainer>),
}Variants§
Uninitialized
Null
Boolean(Boolean)
Integer(Integer)
TypedInteger(TypedInteger)
Decimal(Decimal)
TypedDecimal(TypedDecimal)
Text(Text)
Endpoint(Endpoint)
List(List)
Map(Map)
Type(Type)
EntityTypeDefinition(EntityTypeDefinition)
Callable(Callable)
Range(Range)
Instant(Instant)
Sender(ValueContainerSender)
Receiver(ValueContainerReceiver)
Box(Box<ValueContainer>)
Used for nested values, e.g. #Tagged (shared 42)
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 core_lib_type_id(&self) -> CoreLibTypeId
pub fn core_lib_type_id(&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 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 ConvertValue for CoreValue
impl ConvertValue for CoreValue
fn to_value(self) -> Value
fn try_from_value(value: Value) -> Result<Self, Value>where
Self: Sized,
fn try_borrow_from_value(value: &Value) -> Result<&Self, ()>
fn try_borrow_mut_from_value(value: &mut Value) -> Result<&mut Self, ()>
Source§impl DatexHash for CoreValue
impl DatexHash for CoreValue
fn datex_hash(&self, state: &mut dyn Hasher)
fn datex_hash_default(&self) -> u64
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
Source§impl<'de> DeserializeWithSerdeContext<'de> for CoreValue
impl<'de> DeserializeWithSerdeContext<'de> for CoreValue
fn deserialize_with_ctx<D>(
ctx: &SerdeContext<'_>,
deserializer: D,
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for CoreValue
Source§impl<'a> From<&'a CoreValue> for BorrowedCoreValue<'a>
impl<'a> From<&'a CoreValue> for BorrowedCoreValue<'a>
Source§impl From<&CoreValue> for CoreLibTypeId
impl From<&CoreValue> for CoreLibTypeId
Source§impl From<CoreValue> for CoreValueWithClassification
impl From<CoreValue> for CoreValueWithClassification
Source§impl From<EntityTypeDefinition> for CoreValue
impl From<EntityTypeDefinition> for CoreValue
Source§fn from(value: EntityTypeDefinition) -> Self
fn from(value: EntityTypeDefinition) -> 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 FromParts for CoreValue
impl FromParts for CoreValue
fn try_from_map_parts_with_tag(
parts: Map,
_tag: Option<&str>,
) -> Result<Self, ()>where
Self: Sized,
fn try_from_list_parts_with_tag(
parts: List,
_tag: Option<&str>,
) -> Result<Self, ()>where
Self: Sized,
fn try_from_single_value_with_tag(
value: ValueContainer,
_tag: Option<&str>,
) -> Result<Self, ()>where
Self: Sized,
Source§fn try_from_map_parts(_parts: Map) -> Result<Self, ()>where
Self: Sized,
fn try_from_map_parts(_parts: Map) -> Result<Self, ()>where
Self: Sized,
Tries to construct the implementing type from the given map parts.
Source§fn try_from_list_parts(_parts: List) -> Result<Self, ()>where
Self: Sized,
fn try_from_list_parts(_parts: List) -> Result<Self, ()>where
Self: Sized,
Tries to construct the implementing type from the given list parts.
Source§fn try_from_single_value(_value: ValueContainer) -> Result<Self, ()>where
Self: Sized,
fn try_from_single_value(_value: ValueContainer) -> Result<Self, ()>where
Self: Sized,
Tries to construct the implementing type from a single value.
Source§impl HasPartsKind for CoreValue
impl HasPartsKind for CoreValue
Source§fn parts_kind(&self) -> PartsKind
fn parts_kind(&self) -> PartsKind
Returns the kind of parts that the implementing type can be converted into.
This can be used to check if the conversion is possible before attempting it.
If this returns
PartsKind::None, then the conversion is not possible.
If this returns PartsKind::List, then the conversion is possible and try_into_list_parts() can be called.
If this returns PartsKind::Map, then the conversion is possible and try_into_map_parts() can be called.
If this returns PartsKind::SingleValue, then the conversion is possible and try_from_single_value() can be called.Source§impl IntoParts for CoreValue
impl IntoParts for CoreValue
Source§fn try_into_map_parts<'a>(self: Box<Self>) -> Result<Map, ()>where
Self: 'a,
fn try_into_map_parts<'a>(self: Box<Self>) -> Result<Map, ()>where
Self: 'a,
Converts the implementing type into its map parts.
Returns an error if the conversion is not possible.
You can check if the conversion is possible by calling
parts_kind()
and checking if it returns PartsKind::Map.Source§fn try_into_list_parts<'a>(self: Box<Self>) -> Result<List, ()>where
Self: 'a,
fn try_into_list_parts<'a>(self: Box<Self>) -> Result<List, ()>where
Self: 'a,
Converts the implementing type into its list parts.
Returns an error if the conversion is not possible.
You can check if the conversion is possible by calling
parts_kind()
and checking if it returns PartsKind::List.Source§fn try_into_single_value<'a>(self: Box<Self>) -> Result<ValueContainer, ()>where
Self: 'a,
fn try_into_single_value<'a>(self: Box<Self>) -> Result<ValueContainer, ()>where
Self: 'a,
Converts the implementing type into a single value.
Returns an error if the conversion is not possible.
You can check if the conversion is possible by calling
parts_kind()
and checking if it returns PartsKind::SingleValue.Source§impl IterParts for CoreValue
impl IterParts for CoreValue
fn iter_list_parts<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = BorrowedValueContainer<'a>> + 'a>>
fn iter_list_parts_mut<'a>( &'a mut self, ) -> Option<Box<dyn Iterator<Item = BorrowedValueContainerMut<'a>> + 'a>>
fn iter_map_parts<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = (BorrowedValueContainer<'a>, BorrowedValueContainer<'a>)> + 'a>>
fn iter_map_parts_mut<'a>( &'a mut self, ) -> Option<Box<dyn Iterator<Item = (BorrowedValueContainer<'a>, BorrowedValueContainerMut<'a>)> + 'a>>
fn iter_parts<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = BorrowedValueContainer<'a>> + 'a>>
Source§impl SerializeWithSerdeContext for CoreValue
impl SerializeWithSerdeContext for CoreValue
fn serialize_with_ctx<S: Serializer>( &self, ctx: &SerdeContext<'_>, serializer: S, ) -> Result<S::Ok, S::Error>
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.
Source§impl ToInstructions for CoreValue
impl ToInstructions for CoreValue
fn to_instructions<'a>( &'a self, visitor: &'a mut dyn ValueVisitor, cache: &'a mut SharedReferencesCache, ) -> Box<dyn Iterator<Item = Instruction> + 'a>
Source§impl<'a> TryFrom<&'a mut CoreValue> for BorrowedCoreValueMut<'a>
impl<'a> TryFrom<&'a mut CoreValue> for BorrowedCoreValueMut<'a>
Auto Trait Implementations§
impl !RefUnwindSafe for CoreValue
impl !Send for CoreValue
impl !Sync for CoreValue
impl !UnwindSafe for CoreValue
impl Forget for CoreValue
impl Freeze for CoreValue
impl Move 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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DeserializeWithSerdeContextDyn for Twhere
T: for<'de> DeserializeWithSerdeContext<'de>,
impl<T> DeserializeWithSerdeContextDyn for Twhere
T: for<'de> DeserializeWithSerdeContext<'de>,
fn deserialize_with_ctx_dyn<'de>( ctx: &SerdeContext<'_>, deserializer: &mut dyn Deserializer<'de>, ) -> Result<T, Error>
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> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> SerializeWithSerdeContextDyn for Twhere
T: SerializeWithSerdeContext,
impl<T> SerializeWithSerdeContextDyn for Twhere
T: SerializeWithSerdeContext,
Source§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