pub struct ReferencedSharedContainer { /* private fields */ }Expand description
Wrapper struct for a reference to a shared value (i.e. 'shared X or 'mut shared X).
The inner value can either be a SharedContainerInner::EndpointOwned or SharedContainerInner::External
Implementations§
pub fn inner(&self) -> Ref<'_, SharedContainerInner>
pub fn inner_mut(&self) -> RefMut<'_, SharedContainerInner>
Gets a Ref to the currently assigned BaseSharedValueContainer of the shared container (not resolved recursively)
Gets a RefMut to the currently assigned BaseSharedValueContainer of the shared container (not resolved recursively)
Sourcepub fn value_container(&self) -> Ref<'_, ValueContainer>
pub fn value_container(&self) -> Ref<'_, ValueContainer>
Gets a Ref to the currently assigned ValueContainer of the shared container (not resolved recursively)
Sourcepub fn value_container_mut(&self) -> RefMut<'_, ValueContainer>
pub fn value_container_mut(&self) -> RefMut<'_, ValueContainer>
Gets a RefMut to the currently assigned ValueContainer of the shared container (not resolved recursively)
Sourcepub fn with_collapsed_value_mut<R>(&self, f: impl FnOnce(&mut Value) -> R) -> R
pub fn with_collapsed_value_mut<R>(&self, f: impl FnOnce(&mut Value) -> R) -> R
Calls the provided callback with a mut reference to the recursively collapsed inner value of the shared container
Sourcepub fn with_collapsed_value<R>(&self, f: impl FnOnce(&Value) -> R) -> R
pub fn with_collapsed_value<R>(&self, f: impl FnOnce(&Value) -> R) -> R
Calls the provided callback with a reference to the recursively collapsed inner value of the shared container
Sourcepub fn allowed_type(&self) -> Ref<'_, TypeDefinition>
pub fn allowed_type(&self) -> Ref<'_, TypeDefinition>
Gets a Ref to the currently assigned allowed TypeDefinition of the shared container (not resolved recursively)
Sourcepub fn pointer_address(&self) -> PointerAddress
pub fn pointer_address(&self) -> PointerAddress
Get the inner PointerAddress.
Sourcepub fn container_mutability(&self) -> SharedContainerMutability
pub fn container_mutability(&self) -> SharedContainerMutability
Get the SharedContainerMutability of the inner [SelfOwnedSharedContainer].
Sourcepub fn derive_immutable_reference(&self) -> ReferencedSharedContainer
pub fn derive_immutable_reference(&self) -> ReferencedSharedContainer
Creates a new immutable ReferencedSharedContainer pointing to the same inner value as self.
Sourcepub fn try_derive_mutable_reference(
&self,
) -> Result<ReferencedSharedContainer, UnexpectedImmutableReferenceError>
pub fn try_derive_mutable_reference( &self, ) -> Result<ReferencedSharedContainer, UnexpectedImmutableReferenceError>
Tries to create a new mutable ReferencedSharedContainer pointing to the same inner value as self. Returns an Err if the current reference_mutability is ReferenceMutability::Immutable
Sourcepub fn reference_mutability(&self) -> ReferenceMutability
pub fn reference_mutability(&self) -> ReferenceMutability
Returns the ReferenceMutability of this reference
Trait Implementations§
Source§fn clone(&self) -> ReferencedSharedContainer
fn clone(&self) -> ReferencedSharedContainer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read morefn datex_type(_memory: &mut SharedReferencesCache) -> Type
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>
fn to_value_container(self) -> ValueContainer
Source§fn from(value: ReferencedSharedContainer) -> Self
fn from(value: ReferencedSharedContainer) -> Self
Source§fn structural_eq(&self, other: &Self) -> bool
fn structural_eq(&self, other: &Self) -> bool
Auto Trait Implementations§
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,
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