Skip to main content

SharedRef

Struct SharedRef 

Source
pub struct SharedRef<T: DatexNative + ?Sized> { /* private fields */ }

Implementations§

Source§

impl<T: DatexNative> SharedRef<T>

Source

pub fn into_container(self) -> ReferencedSharedContainer

Source

pub fn container(&self) -> &ReferencedSharedContainer

Source

pub fn borrow(&self) -> Ref<'_, T>

Source

pub fn borrow_mut(&mut self) -> RefMut<'_, T>

Source

pub fn mark_debug(&self, is_debug: bool)

Source§

impl<T: DatexNative + 'static> SharedRef<T>

Source

pub fn new( value: T, address_provider: &mut SelfOwnedPointerAddressProvider, ) -> Self

Trait Implementations§

Source§

impl<T> ConvertValueContainer for SharedRef<T>

Source§

fn to_value_container(self) -> ValueContainer

Convert the value to a ValueContainer
Source§

fn as_borrowed_value_container(&self) -> BorrowedValueContainer<'_>

Borrow the value as a BorrowedValueContainer
Source§

fn as_borrowed_value_container_mut(&mut self) -> BorrowedValueContainerMut<'_>

Borrow the value as a mutable BorrowedValueContainer
Source§

fn try_from_value_container( value_container: ValueContainer, ) -> Result<Self, ValueContainer>
where Self: Sized,

Tries to downcast a ValueContainer into Self
Source§

fn try_borrow_from_value_container( _value_container: &ValueContainer, ) -> Result<&Self, ()>
where Self: Sized,

Tries to downcast a ValueContainer into a reference of Self
Source§

fn try_borrow_mut_from_value_container( _value_container: &mut ValueContainer, ) -> Result<&mut Self, ()>
where Self: Sized,

Tries to downcast a ValueContainer into a mutable reference of Self
Source§

impl<T: Debug + DatexNative + ?Sized> Debug for SharedRef<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Eq + DatexNative + ?Sized> Eq for SharedRef<T>

Source§

impl<T> GetDatexType for SharedRef<T>

Source§

impl<T: PartialEq + DatexNative + ?Sized> PartialEq for SharedRef<T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq + DatexNative + ?Sized> StructuralPartialEq for SharedRef<T>

Source§

impl<T: DatexNative + 'static> TryFrom<OwnedSharedContainer> for SharedRef<T>

Source§

type Error = OwnedSharedContainer

The type returned in the event of a conversion error.
Source§

fn try_from(container: OwnedSharedContainer) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: DatexNative + 'static> TryFrom<ReferencedSharedContainer> for SharedRef<T>

Source§

type Error = ReferencedSharedContainer

The type returned in the event of a conversion error.
Source§

fn try_from(container: ReferencedSharedContainer) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for SharedRef<T>

§

impl<T> !Send for SharedRef<T>

§

impl<T> !Sync for SharedRef<T>

§

impl<T> !UnwindSafe for SharedRef<T>

§

impl<T> Forget for SharedRef<T>
where T: ?Sized,

§

impl<T> Freeze for SharedRef<T>
where PhantomData<T>: Freeze, T: ?Sized,

§

impl<T> Move for SharedRef<T>
where T: ?Sized,

§

impl<T> Unpin for SharedRef<T>
where PhantomData<T>: Unpin, T: ?Sized,

§

impl<T> UnsafeUnpin for SharedRef<T>
where PhantomData<T>: UnsafeUnpin, T: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DynEq for T
where T: Any,

Source§

default fn dyn_eq(&self, _other: &(dyn Any + 'static)) -> bool

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetAllowedType for T
where T: GetDatexType,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> TryClone for T

Source§

default fn try_clone(&self) -> Result<Value, ()>

Attempts to clone Self into a new Value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TypeSubset<U> for T
where U: TypeSuperset<T>,

Source§

fn is_subset_of(&self, other: &U) -> bool

Returns whether self is a subset of type