ManagedGc

Struct ManagedGc 

Source
pub struct ManagedGc<T> { /* private fields */ }

Implementations§

Source§

impl<T> ManagedGc<T>

Source

pub fn new(data: T) -> ManagedGc<T>

Source

pub unsafe fn new_cyclic(f: impl FnOnce(ManagedGc<T>) -> T) -> ManagedGc<T>

§Safety
Source

pub fn reference(&self) -> ManagedGc<T>

Source

pub fn consume(self) -> Result<T, ManagedGc<T>>

Source

pub fn into_dynamic(self) -> DynamicManagedGc

Source

pub fn renew(&mut self)

Source

pub fn type_hash(&self) -> TypeHash

Source

pub fn lifetime(&self) -> ManagedGcLifetime<'_>

Source

pub fn exists(&self) -> bool

Source

pub fn is_owning(&self) -> bool

Source

pub fn is_referencing(&self) -> bool

Source

pub fn is_owned_by(&self, other: &ManagedGc<T>) -> bool

Source

pub fn transfer_ownership(&mut self, new_owner: &mut ManagedGc<T>) -> bool

Source

pub fn try_read(&self) -> Option<ValueReadAccess<'_, T>>

Source

pub fn try_write(&mut self) -> Option<ValueWriteAccess<'_, T>>

Source

pub fn read<const LOCKING: bool>(&self) -> ValueReadAccess<'_, T>

Source

pub fn write<const LOCKING: bool>(&mut self) -> ValueWriteAccess<'_, T>

Source

pub fn try_borrow(&self) -> Option<ManagedRef<T>>

Source

pub fn try_borrow_mut(&self) -> Option<ManagedRefMut<T>>

Source

pub fn borrow<const LOCKING: bool>(&self) -> ManagedRef<T>

Source

pub fn borrow_mut<const LOCKING: bool>(&mut self) -> ManagedRefMut<T>

Source

pub fn lazy(&self) -> ManagedLazy<T>

Source

pub unsafe fn as_ptr(&self) -> *const T

§Safety
Source

pub unsafe fn as_mut_ptr(&mut self) -> *mut T

§Safety

Trait Implementations§

Source§

impl<T> Default for ManagedGc<T>
where T: Default,

Source§

fn default() -> ManagedGc<T>

Returns the “default value” for a type. Read more
Source§

impl<T> From<ManagedGc<T>> for ManagedValue<T>

Source§

fn from(value: ManagedGc<T>) -> ManagedValue<T>

Converts to this type from the input type.
Source§

impl<T> TryFrom<ManagedValue<T>> for ManagedGc<T>

Source§

type Error = ()

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

fn try_from( value: ManagedValue<T>, ) -> Result<ManagedGc<T>, <ManagedGc<T> as TryFrom<ManagedValue<T>>>::Error>

Performs the conversion.
Source§

impl<T> Send for ManagedGc<T>

Source§

impl<T> Sync for ManagedGc<T>

Auto Trait Implementations§

§

impl<T> Freeze for ManagedGc<T>

§

impl<T> RefUnwindSafe for ManagedGc<T>

§

impl<T> Unpin for ManagedGc<T>

§

impl<T> UnwindSafe for ManagedGc<T>

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> Finalize for T

Source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Initialize for T
where T: Default,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.