pub struct Value {
pub inner: CoreValue,
pub custom_type: Option<TypeDefinition>,
}Fields§
§inner: CoreValue§custom_type: Option<TypeDefinition>Implementations§
Source§impl Value
impl Value
pub fn callable( name: Option<String>, signature: CallableTypeDefinition, body: CallableBody, ) -> Self
pub fn is_null(&self) -> bool
pub fn is_text(&self) -> bool
pub fn is_integer_i8(&self) -> bool
pub fn is_map(&self) -> bool
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 has_default_type(&self) -> bool
pub fn has_default_type(&self) -> bool
Returns true if the current Value’s actual type is the same as its default type E.g. if the type is integer for an Integer value, or integer/u8 for a typed integer value This will return false for an integer value if the actual type is one of the following:
- an ImplType<integer, x>
- a new nominal type containing an integer TODO #604: this does not match all cases of default types from the point of view of the compiler - integer variants (despite bigint) can be distinguished based on the instruction code, but for text variants, the variant must be included in the compiler output - so we need to handle theses cases as well. Generally speaking, all variants except the few integer variants should never be considered default types.
Sourcepub fn actual_type(&self) -> TypeDefinition
pub fn actual_type(&self) -> TypeDefinition
Returns the actual type, generating the default type from the provided memory if no custom typoe is set
Sourcepub fn try_get_property<'a>(
&self,
key: impl Into<BorrowedValueKey<'a>>,
) -> Result<ValueContainer, AccessError>
pub fn try_get_property<'a>( &self, key: impl Into<BorrowedValueKey<'a>>, ) -> Result<ValueContainer, AccessError>
Gets a property on the value if applicable (e.g. for map and structs)
Sourcepub fn try_take_property<'a>(
&mut self,
key: impl Into<BorrowedValueKey<'a>>,
) -> Result<ValueContainer, AccessError>
pub fn try_take_property<'a>( &mut self, key: impl Into<BorrowedValueKey<'a>>, ) -> Result<ValueContainer, AccessError>
Takes (removes) a property from the value if applicable (e.g. for map and structs)
pub fn try_delete_property<'a>( &mut self, key: impl Into<BorrowedValueKey<'a>>, ) -> Result<(), AccessError>
Sourcepub fn try_set_property<'a>(
&mut self,
key: impl Into<BorrowedValueKey<'a>>,
val: ValueContainer,
) -> Result<(), AccessError>
pub fn try_set_property<'a>( &mut self, key: impl Into<BorrowedValueKey<'a>>, val: ValueContainer, ) -> Result<(), AccessError>
Sets a property on the value if applicable (e.g. for maps)
Methods from Deref<Target = 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.
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<T> AddAssign<T> for Value
impl<T> AddAssign<T> for Value
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+= operation. Read moreSource§impl Apply for Value
impl Apply for Value
Source§fn try_apply(
&self,
args: &[ValueContainer],
) -> Result<Option<ValueContainer>, ApplyError>
fn try_apply( &self, args: &[ValueContainer], ) -> Result<Option<ValueContainer>, ApplyError>
Source§fn try_apply_single(
&self,
arg: &ValueContainer,
) -> Result<Option<ValueContainer>, ApplyError>
fn try_apply_single( &self, arg: &ValueContainer, ) -> Result<Option<ValueContainer>, ApplyError>
Source§impl<'a> ChildIterator<'a> for Value
impl<'a> ChildIterator<'a> for Value
fn iter_children(&self) -> impl Iterator<Item = &ValueContainer>
Source§impl DatexProxyTypes for Value
impl DatexProxyTypes for Value
fn datex_type(_memory: &mut SharedReferencesCache) -> Type
impl DatexValueProxy for Value
Source§impl DatexValueProxyDeserialize for Value
impl DatexValueProxyDeserialize for Value
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 Value
impl DatexValueProxySerialize for Value
fn try_to_value(self) -> Result<Value, TryToDatexValueError>
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
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>,
impl Eq for Value
Source§impl<'a> From<&'a Value> for BorrowedValueContainer<'a>
impl<'a> From<&'a Value> for BorrowedValueContainer<'a>
Source§impl From<AcceptAddress> for Value
impl From<AcceptAddress> for Value
Source§fn from(value: AcceptAddress) -> Self
fn from(value: AcceptAddress) -> Self
Source§impl From<ComHubMetadata> for Value
impl From<ComHubMetadata> for Value
Source§fn from(value: ComHubMetadata) -> Self
fn from(value: ComHubMetadata) -> Self
Source§impl From<ComHubMetadataInterface> for Value
impl From<ComHubMetadataInterface> for Value
Source§fn from(value: ComHubMetadataInterface) -> Self
fn from(value: ComHubMetadataInterface) -> Self
Source§impl From<ComHubMetadataInterfaceSocket> for Value
impl From<ComHubMetadataInterfaceSocket> for Value
Source§fn from(value: ComHubMetadataInterfaceSocket) -> Self
fn from(value: ComHubMetadataInterfaceSocket) -> Self
Source§impl From<ComInterfaceProperties> for Value
impl From<ComInterfaceProperties> for Value
Source§fn from(value: ComInterfaceProperties) -> Self
fn from(value: ComInterfaceProperties) -> Self
Source§impl From<DisassemblerOptions> for Value
impl From<DisassemblerOptions> for Value
Source§fn from(value: DisassemblerOptions) -> Self
fn from(value: DisassemblerOptions) -> Self
Source§impl From<DynamicEndpointProperties> for Value
impl From<DynamicEndpointProperties> for Value
Source§fn from(value: DynamicEndpointProperties) -> Self
fn from(value: DynamicEndpointProperties) -> Self
Source§impl From<HTTPClientInterfaceSetupData> for Value
impl From<HTTPClientInterfaceSetupData> for Value
Source§fn from(value: HTTPClientInterfaceSetupData) -> Self
fn from(value: HTTPClientInterfaceSetupData) -> Self
Source§impl From<HTTPServerInterfaceSetupData> for Value
impl From<HTTPServerInterfaceSetupData> for Value
Source§fn from(value: HTTPServerInterfaceSetupData) -> Self
fn from(value: HTTPServerInterfaceSetupData) -> Self
Source§impl From<InterfaceDirection> for Value
impl From<InterfaceDirection> for Value
Source§fn from(value: InterfaceDirection) -> Self
fn from(value: InterfaceDirection) -> Self
Source§impl From<InterfacePriority> for Value
impl From<InterfacePriority> for Value
Source§fn from(value: InterfacePriority) -> Self
fn from(value: InterfacePriority) -> Self
Source§impl From<NetworkTraceHop> for Value
impl From<NetworkTraceHop> for Value
Source§fn from(value: NetworkTraceHop) -> Self
fn from(value: NetworkTraceHop) -> Self
Source§impl From<NetworkTraceHopDirection> for Value
impl From<NetworkTraceHopDirection> for Value
Source§fn from(value: NetworkTraceHopDirection) -> Self
fn from(value: NetworkTraceHopDirection) -> Self
Source§impl From<NetworkTraceHopSocket> for Value
impl From<NetworkTraceHopSocket> for Value
Source§fn from(value: NetworkTraceHopSocket) -> Self
fn from(value: NetworkTraceHopSocket) -> Self
Source§impl From<NetworkTraceResult> for Value
impl From<NetworkTraceResult> for Value
Source§fn from(value: NetworkTraceResult) -> Self
fn from(value: NetworkTraceResult) -> Self
Source§impl From<RTCIceCandidateInitDX> for Value
impl From<RTCIceCandidateInitDX> for Value
Source§fn from(value: RTCIceCandidateInitDX) -> Self
fn from(value: RTCIceCandidateInitDX) -> Self
Source§impl From<RTCIceServerDX> for Value
impl From<RTCIceServerDX> for Value
Source§fn from(value: RTCIceServerDX) -> Self
fn from(value: RTCIceServerDX) -> Self
Source§impl From<RTCSdpTypeDX> for Value
impl From<RTCSdpTypeDX> for Value
Source§fn from(value: RTCSdpTypeDX) -> Self
fn from(value: RTCSdpTypeDX) -> Self
Source§impl From<RTCSessionDescriptionDX> for Value
impl From<RTCSessionDescriptionDX> for Value
Source§fn from(value: RTCSessionDescriptionDX) -> Self
fn from(value: RTCSessionDescriptionDX) -> Self
Source§impl From<ReconnectionConfig> for Value
impl From<ReconnectionConfig> for Value
Source§fn from(value: ReconnectionConfig) -> Self
fn from(value: ReconnectionConfig) -> Self
Source§impl From<RuntimeConfig> for Value
impl From<RuntimeConfig> for Value
Source§fn from(value: RuntimeConfig) -> Self
fn from(value: RuntimeConfig) -> Self
Source§impl From<RuntimeConfigInterface> for Value
impl From<RuntimeConfigInterface> for Value
Source§fn from(value: RuntimeConfigInterface) -> Self
fn from(value: RuntimeConfigInterface) -> Self
Source§impl From<SerialClientInterfaceSetupData> for Value
impl From<SerialClientInterfaceSetupData> for Value
Source§fn from(value: SerialClientInterfaceSetupData) -> Self
fn from(value: SerialClientInterfaceSetupData) -> Self
Source§impl From<TCPClientInterfaceSetupData> for Value
impl From<TCPClientInterfaceSetupData> for Value
Source§fn from(value: TCPClientInterfaceSetupData) -> Self
fn from(value: TCPClientInterfaceSetupData) -> Self
Source§impl From<TCPServerInterfaceSetupData> for Value
impl From<TCPServerInterfaceSetupData> for Value
Source§fn from(value: TCPServerInterfaceSetupData) -> Self
fn from(value: TCPServerInterfaceSetupData) -> Self
Source§impl From<WebRTCInterfaceSetupData> for Value
impl From<WebRTCInterfaceSetupData> for Value
Source§fn from(value: WebRTCInterfaceSetupData) -> Self
fn from(value: WebRTCInterfaceSetupData) -> Self
Source§impl From<WebRTCRoleDX> for Value
impl From<WebRTCRoleDX> for Value
Source§fn from(value: WebRTCRoleDX) -> Self
fn from(value: WebRTCRoleDX) -> Self
Source§impl From<WebRTCSignalDX> for Value
impl From<WebRTCSignalDX> for Value
Source§fn from(value: WebRTCSignalDX) -> Self
fn from(value: WebRTCSignalDX) -> Self
Source§impl From<WebSocketClientInterfaceSetupData> for Value
impl From<WebSocketClientInterfaceSetupData> for Value
Source§fn from(value: WebSocketClientInterfaceSetupData) -> Self
fn from(value: WebSocketClientInterfaceSetupData) -> Self
Source§impl From<WebSocketServerInterfaceSetupData> for Value
impl From<WebSocketServerInterfaceSetupData> for Value
Source§fn from(value: WebSocketServerInterfaceSetupData) -> Self
fn from(value: WebSocketServerInterfaceSetupData) -> Self
Source§impl StructuralEq for Value
Two values are structurally equal, if their inner values are structurally equal, regardless
of the actual_type of the values
impl StructuralEq for Value
Two values are structurally equal, if their inner values are structurally equal, regardless of the actual_type of the values
Source§fn structural_eq(&self, other: &Self) -> bool
fn structural_eq(&self, other: &Self) -> bool
impl StructuralPartialEq for Value
Source§impl TryFrom<Value> for DynamicEndpointProperties
impl TryFrom<Value> for DynamicEndpointProperties
Source§impl TryFrom<Value> for ComHubMetadataInterfaceSocket
impl TryFrom<Value> for ComHubMetadataInterfaceSocket
Source§impl TryFrom<Value> for ComHubMetadataInterface
impl TryFrom<Value> for ComHubMetadataInterface
Source§impl TryFrom<Value> for ComHubMetadata
impl TryFrom<Value> for ComHubMetadata
Source§impl TryFrom<Value> for NetworkTraceHopSocket
impl TryFrom<Value> for NetworkTraceHopSocket
Source§impl TryFrom<Value> for NetworkTraceHopDirection
impl TryFrom<Value> for NetworkTraceHopDirection
Source§impl TryFrom<Value> for NetworkTraceHop
impl TryFrom<Value> for NetworkTraceHop
Source§impl TryFrom<Value> for NetworkTraceResult
impl TryFrom<Value> for NetworkTraceResult
Source§impl TryFrom<Value> for InterfacePriority
impl TryFrom<Value> for InterfacePriority
Source§impl TryFrom<Value> for InterfaceDirection
impl TryFrom<Value> for InterfaceDirection
Source§impl TryFrom<Value> for ComInterfaceProperties
impl TryFrom<Value> for ComInterfaceProperties
Source§impl TryFrom<Value> for ReconnectionConfig
impl TryFrom<Value> for ReconnectionConfig
Source§impl TryFrom<Value> for HTTPClientInterfaceSetupData
impl TryFrom<Value> for HTTPClientInterfaceSetupData
Source§impl TryFrom<Value> for HTTPServerInterfaceSetupData
impl TryFrom<Value> for HTTPServerInterfaceSetupData
Source§impl TryFrom<Value> for AcceptAddress
impl TryFrom<Value> for AcceptAddress
Source§impl TryFrom<Value> for TCPClientInterfaceSetupData
impl TryFrom<Value> for TCPClientInterfaceSetupData
Source§impl TryFrom<Value> for TCPServerInterfaceSetupData
impl TryFrom<Value> for TCPServerInterfaceSetupData
Source§impl TryFrom<Value> for RTCIceCandidateInitDX
impl TryFrom<Value> for RTCIceCandidateInitDX
Source§impl TryFrom<Value> for RTCSdpTypeDX
impl TryFrom<Value> for RTCSdpTypeDX
Source§impl TryFrom<Value> for RTCSessionDescriptionDX
impl TryFrom<Value> for RTCSessionDescriptionDX
Source§impl TryFrom<Value> for RTCIceServerDX
impl TryFrom<Value> for RTCIceServerDX
Source§impl TryFrom<Value> for WebRTCRoleDX
impl TryFrom<Value> for WebRTCRoleDX
Source§impl TryFrom<Value> for WebRTCInterfaceSetupData
impl TryFrom<Value> for WebRTCInterfaceSetupData
Source§impl TryFrom<Value> for WebRTCSignalDX
impl TryFrom<Value> for WebRTCSignalDX
Source§impl TryFrom<Value> for RuntimeConfigInterface
impl TryFrom<Value> for RuntimeConfigInterface
Source§impl TryFrom<Value> for RuntimeConfig
impl TryFrom<Value> for RuntimeConfig
Source§impl TryFrom<Value> for DisassemblerOptions
impl TryFrom<Value> for DisassemblerOptions
Source§impl TryFrom<Value> for TypedInteger
impl TryFrom<Value> for TypedInteger
Source§impl TryFrom<Value> for TypedDecimal
impl TryFrom<Value> for TypedDecimal
Source§impl TryFrom<Value> for NominalTypeDefinition
impl TryFrom<Value> for NominalTypeDefinition
Source§impl UpdateHandler for Value
impl UpdateHandler for Value
fn try_set_entry( &mut self, data: SetEntryUpdateData, source_id: TransceiverId, ) -> Result<(), UpdateError>
fn try_delete_entry( &mut self, data: DeleteEntryUpdateData, source_id: TransceiverId, ) -> Result<ValueContainer, UpdateError>
fn try_append_entry( &mut self, data: AppendEntryUpdateData, source_id: TransceiverId, ) -> Result<(), UpdateError>
fn try_clear(&mut self, source_id: TransceiverId) -> Result<(), UpdateError>
fn try_list_splice( &mut self, _data: ListSpliceUpdateData, _source_id: TransceiverId, ) -> Result<Vec<ValueContainer>, UpdateError>
fn update(&mut self, update: Update) -> UpdateResult
fn try_replace( &mut self, _data: ReplaceUpdateData, _source_id: TransceiverId, ) -> Result<ValueContainer, UpdateError>
Auto Trait Implementations§
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl !UnwindSafe for Value
impl Freeze for Value
impl Unpin for Value
impl UnsafeUnpin for Value
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,
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>
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
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>
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 more