pub enum ValueContainer {
Local(Value),
Shared(SharedContainer),
}Variants§
Implementations§
Source§impl ValueContainer
impl ValueContainer
Sourcepub fn with_collapsed_value<R, F: FnOnce(&Value) -> R>(&self, f: F) -> R
pub fn with_collapsed_value<R, F: FnOnce(&Value) -> R>(&self, f: F) -> R
Calls a fn with a reference to the current inner collapsed value of the container
Sourcepub fn get_cloned_value(&self) -> Value
pub fn get_cloned_value(&self) -> Value
Gets a cloned, collapsed inner value. Use ValueContainer::with_collapsed_value instead whenever possible or match the ValueContainer
Sourcepub fn try_as<'a, T>(&'a self) -> Option<&'a T>
pub fn try_as<'a, T>(&'a self) -> Option<&'a T>
Tries to get an immutable reference to the value as a specified type. Does not perform any type conversion. This only works for local values, not for shared values.
Sourcepub fn try_as_mut<'a, T>(&'a mut self) -> Option<&'a mut T>
pub fn try_as_mut<'a, T>(&'a mut self) -> Option<&'a mut T>
Tries to get a mutable reference to the value as a specified type. Does not perform any type conversion. This only works for local values, not for shared values.
Sourcepub fn try_with<T, R, F>(&self, f: F) -> Option<R>
pub fn try_with<T, R, F>(&self, f: F) -> Option<R>
Tries to get the current collapsed value as a specified type. Does not perform any type conversion. Runs the provided closure with a reference to the typed value if the conversion was successful, otherwise returns None.
Sourcepub fn try_into_value<T>(self) -> Option<T>
pub fn try_into_value<T>(self) -> Option<T>
Tries to get the current collapsed value as a specified type. Does not perform any type conversion. This only works for local values, not for shared values.
Sourcepub fn get_cloned(&self) -> ValueContainer
pub fn get_cloned(&self) -> ValueContainer
Performs a clone used by the “clone” command Local values are just cloned normally For shared value, the inner value container is cloned (shared x -> x)
Sourcepub fn actual_type(&self) -> TypeDefinition
pub fn actual_type(&self) -> TypeDefinition
Returns the actual type of the contained value, resolving shared values if necessary.
Sourcepub fn actual_container_type(&self) -> TypeDefinitionWithMetadata
pub fn actual_container_type(&self) -> TypeDefinitionWithMetadata
Returns the actual type that describes the value container (e.g. integer or ’mut shared mut integer).
Sourcepub fn allowed_or_actual_type(&self) -> TypeDefinition
pub fn allowed_or_actual_type(&self) -> TypeDefinition
For local values, returns the actual type of the value container For shared values, returns the allowed type of the value container
Returns the contained SharedContainer if it is a SharedContainer, otherwise returns None.
Runs a closure with the contained SharedContainer if it is a SharedContainer, otherwise returns None.
Returns a reference to the contained SharedContainer, panics if it is not a SharedContainer.
pub fn try_get_property<'a>( &self, key: impl Into<BorrowedValueKey<'a>>, ) -> Result<ValueContainer, AccessError>
Trait Implementations§
Source§impl Add for ValueContainer
impl Add for ValueContainer
Source§type Output = Result<ValueContainer, ValueError>
type Output = Result<ValueContainer, ValueError>
+ operator.Source§impl Add<&ValueContainer> for &ValueContainer
impl Add<&ValueContainer> for &ValueContainer
Source§type Output = Result<ValueContainer, ValueError>
type Output = Result<ValueContainer, ValueError>
+ operator.Source§impl Apply for ValueContainer
impl Apply for ValueContainer
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 Clone for ValueContainer
impl Clone for ValueContainer
Source§fn clone(&self) -> ValueContainer
fn clone(&self) -> ValueContainer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DatexProxyTypes for ValueContainer
impl DatexProxyTypes for ValueContainer
fn datex_type(_memory: &mut SharedReferencesCache) -> Type
impl DatexValueContainerProxy for ValueContainer
Custom DatexValueContainerProxy for ValueContainer - just return as is
Source§impl DatexValueContainerProxyDeserialize for ValueContainer
impl DatexValueContainerProxyDeserialize for ValueContainer
fn try_from_value_container( value: ValueContainer, ) -> Result<Self, TryFromDatexValueError>
fn try_from_map_property( value: Result<ValueContainer, KeyNotFoundError>, ) -> Result<Self, 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 DatexValueContainerProxyInfallibleSerialize for ValueContainer
impl DatexValueContainerProxyInfallibleSerialize for ValueContainer
fn to_value_container(self) -> ValueContainer
Source§impl Debug for ValueContainer
impl Debug for ValueContainer
Source§impl<'de> Deserialize<'de> for ValueContainer
impl<'de> Deserialize<'de> for ValueContainer
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>,
Source§impl Display for ValueContainer
impl Display for ValueContainer
impl Eq for ValueContainer
Source§impl<'a> From<&'a ValueContainer> for BorrowedValueContainer<'a>
impl<'a> From<&'a ValueContainer> for BorrowedValueContainer<'a>
Source§fn from(container: &'a ValueContainer) -> Self
fn from(container: &'a ValueContainer) -> Self
Source§impl<'a> From<&'a ValueContainer> for BorrowedValueKey<'a>
impl<'a> From<&'a ValueContainer> for BorrowedValueKey<'a>
Source§fn from(value_container: &'a ValueContainer) -> Self
fn from(value_container: &'a ValueContainer) -> Self
Source§impl<'a> From<BorrowedMapKey<'a>> for ValueContainer
impl<'a> From<BorrowedMapKey<'a>> for ValueContainer
Source§fn from(key: BorrowedMapKey<'_>) -> Self
fn from(key: BorrowedMapKey<'_>) -> Self
Source§impl<'a> From<BorrowedValueKey<'a>> for ValueContainer
impl<'a> From<BorrowedValueKey<'a>> for ValueContainer
Source§fn from(value_key: BorrowedValueKey<'_>) -> Self
fn from(value_key: BorrowedValueKey<'_>) -> Self
Source§impl From<MapKey> for ValueContainer
impl From<MapKey> for ValueContainer
Source§impl From<ValueContainer> for UpdateReturn
impl From<ValueContainer> for UpdateReturn
Source§fn from(value: ValueContainer) -> Self
fn from(value: ValueContainer) -> Self
Source§impl From<ValueContainer> for BorrowedValueKey<'_>
impl From<ValueContainer> for BorrowedValueKey<'_>
Source§fn from(value_container: ValueContainer) -> Self
fn from(value_container: ValueContainer) -> Self
Source§impl From<ValueContainer> for ValueKey
impl From<ValueContainer> for ValueKey
Source§fn from(value_container: ValueContainer) -> Self
fn from(value_container: ValueContainer) -> Self
Source§impl Hash for ValueContainer
impl Hash for ValueContainer
Source§impl Identity for ValueContainer
Identity checks only returns true if two references are identical.
Values are never identical to references or other values.
impl Identity for ValueContainer
Identity checks only returns true if two references are identical. Values are never identical to references or other values.
Source§impl Neg for ValueContainer
impl Neg for ValueContainer
Source§impl PartialEq for ValueContainer
Partial equality for ValueContainer is identical to Hash behavior:
Identical references are partially equal, value-equal values are also partially equal.
A pointer and a value are never partially equal.
impl PartialEq for ValueContainer
Partial equality for ValueContainer is identical to Hash behavior: Identical references are partially equal, value-equal values are also partially equal. A pointer and a value are never partially equal.
Source§impl Serialize for ValueContainer
impl Serialize for ValueContainer
Source§impl StructuralEq for ValueContainer
Structural equality checks the structural equality of the underlying values, collapsing
references to their current resolved values.
impl StructuralEq for ValueContainer
Structural equality checks the structural equality of the underlying values, collapsing references to their current resolved values.
Source§fn structural_eq(&self, other: &Self) -> bool
fn structural_eq(&self, other: &Self) -> bool
Source§impl Sub for ValueContainer
impl Sub for ValueContainer
Source§type Output = Result<ValueContainer, ValueError>
type Output = Result<ValueContainer, ValueError>
- operator.Source§impl Sub<&ValueContainer> for &ValueContainer
impl Sub<&ValueContainer> for &ValueContainer
Source§type Output = Result<ValueContainer, ValueError>
type Output = Result<ValueContainer, ValueError>
- operator.Source§impl TryFrom<ValueContainer> for DynamicEndpointProperties
impl TryFrom<ValueContainer> for DynamicEndpointProperties
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for ComHubMetadataInterfaceSocket
impl TryFrom<ValueContainer> for ComHubMetadataInterfaceSocket
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for ComHubMetadataInterface
impl TryFrom<ValueContainer> for ComHubMetadataInterface
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for ComHubMetadata
impl TryFrom<ValueContainer> for ComHubMetadata
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for NetworkTraceHopSocket
impl TryFrom<ValueContainer> for NetworkTraceHopSocket
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for NetworkTraceHopDirection
impl TryFrom<ValueContainer> for NetworkTraceHopDirection
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for NetworkTraceHop
impl TryFrom<ValueContainer> for NetworkTraceHop
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for NetworkTraceResult
impl TryFrom<ValueContainer> for NetworkTraceResult
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for InterfacePriority
impl TryFrom<ValueContainer> for InterfacePriority
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for InterfaceDirection
impl TryFrom<ValueContainer> for InterfaceDirection
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for ComInterfaceProperties
impl TryFrom<ValueContainer> for ComInterfaceProperties
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for ReconnectionConfig
impl TryFrom<ValueContainer> for ReconnectionConfig
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for HTTPClientInterfaceSetupData
impl TryFrom<ValueContainer> for HTTPClientInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for HTTPServerInterfaceSetupData
impl TryFrom<ValueContainer> for HTTPServerInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for TLSMode
impl TryFrom<ValueContainer> for TLSMode
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for AcceptAddress
impl TryFrom<ValueContainer> for AcceptAddress
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for SerialClientInterfaceSetupData
impl TryFrom<ValueContainer> for SerialClientInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for TCPClientInterfaceSetupData
impl TryFrom<ValueContainer> for TCPClientInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for TCPServerInterfaceSetupData
impl TryFrom<ValueContainer> for TCPServerInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for RTCIceCandidateInitDX
impl TryFrom<ValueContainer> for RTCIceCandidateInitDX
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for RTCSdpTypeDX
impl TryFrom<ValueContainer> for RTCSdpTypeDX
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for RTCSessionDescriptionDX
impl TryFrom<ValueContainer> for RTCSessionDescriptionDX
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for RTCIceServerDX
impl TryFrom<ValueContainer> for RTCIceServerDX
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for WebRTCRoleDX
impl TryFrom<ValueContainer> for WebRTCRoleDX
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for WebRTCInterfaceSetupData
impl TryFrom<ValueContainer> for WebRTCInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for WebRTCSignalDX
impl TryFrom<ValueContainer> for WebRTCSignalDX
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for WebSocketClientInterfaceSetupData
impl TryFrom<ValueContainer> for WebSocketClientInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for WebSocketServerInterfaceSetupData
impl TryFrom<ValueContainer> for WebSocketServerInterfaceSetupData
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for RuntimeConfigInterface
impl TryFrom<ValueContainer> for RuntimeConfigInterface
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for RuntimeConfig
impl TryFrom<ValueContainer> for RuntimeConfig
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for DisassemblerOptions
impl TryFrom<ValueContainer> for DisassemblerOptions
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for Type
impl TryFrom<ValueContainer> for Type
Source§impl TryFrom<ValueContainer> for bool
impl TryFrom<ValueContainer> for bool
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for u8
impl TryFrom<ValueContainer> for u8
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for u16
impl TryFrom<ValueContainer> for u16
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for u32
impl TryFrom<ValueContainer> for u32
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for u64
impl TryFrom<ValueContainer> for u64
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for usize
impl TryFrom<ValueContainer> for usize
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for i8
impl TryFrom<ValueContainer> for i8
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for i16
impl TryFrom<ValueContainer> for i16
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for i32
impl TryFrom<ValueContainer> for i32
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for i64
impl TryFrom<ValueContainer> for i64
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for isize
impl TryFrom<ValueContainer> for isize
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for f32
impl TryFrom<ValueContainer> for f32
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for f64
impl TryFrom<ValueContainer> for f64
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl TryFrom<ValueContainer> for String
impl TryFrom<ValueContainer> for String
Source§type Error = TryFromDatexValueError
type Error = TryFromDatexValueError
Source§impl UpdateHandler for ValueContainer
impl UpdateHandler for ValueContainer
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 ValueContainer
impl !Send for ValueContainer
impl !Sync for ValueContainer
impl !UnwindSafe for ValueContainer
impl Freeze for ValueContainer
impl Unpin for ValueContainer
impl UnsafeUnpin for ValueContainer
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> 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