Struct zerogc_context::handle::GcHandle[][src]

pub struct GcHandle<T: GcSafe, C: RawHandleImpl> { /* fields omitted */ }

Trait Implementations

impl<T: GcSafe, C: RawHandleImpl> Clone for GcHandle<T, C>[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: GcSafe, C: RawHandleImpl> Drop for GcHandle<T, C>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl<'new_gc, T, C> GcBindHandle<'new_gc, T> for GcHandle<T, C> where
    T: GcSafe,
    T: GcRebrand<'new_gc, CollectorId<C>>,
    T::Branded: GcSafe,
    C: RawHandleImplHack<'new_gc, T::Branded>, 
[src]

type Gc = C::Gc

The type of the rebranded references

fn bind_to(&self, context: &'new_gc CollectorContext<C>) -> Self::Gc[src]

Associate this handle with the specified context, allowing its underlying object to be accessed as long as the context is valid. Read more

impl<T: GcSafe, C: RawHandleImpl> GcHandle<T> for GcHandle<T, C>[src]

type System = CollectorRef<C>

The type of the system used with this handle

type Id = CollectorId<C>

The type of CollectorId used with this sytem

fn use_critical<R>(&self, func: impl FnOnce(&T) -> R) -> R[src]

Access this handle inside the closure, possibly associating it with the specified Read more

impl<T: GcSafe, C: RawHandleImpl> Trace for GcHandle<T, C>[src]

const NEEDS_TRACE: bool[src]

See docs on reachability

fn visit<V>(&mut self, _visitor: &mut V) -> Result<(), V::Err> where
    V: GcVisitor
[src]

Visit each field in this type Read more

impl<T: GcSafe, C: RawHandleImpl> TraceImmutable for GcHandle<T, C>[src]

fn visit_immutable<V>(&self, _visitor: &mut V) -> Result<(), V::Err> where
    V: GcVisitor
[src]

Visit an immutable reference to this type Read more

impl<T: GcSafe, C: RawHandleImpl> NullTrace for GcHandle<T, C>[src]

impl<T: GcSafe + Sync, C: RawHandleImpl + Sync> Send for GcHandle<T, C>[src]

In order to send references between threads, the underlying type must be sync.

This is the same reason that Arc<T>: Send requires T: Sync

Requires that the collector is thread-safe.

impl<T: GcSafe + Sync, C: RawHandleImpl + Sync> Sync for GcHandle<T, C>[src]

If the underlying type is Sync, it’s safe to share garbage collected references between threads.

Requires that the collector is thread-safe.

Auto Trait Implementations

impl<T, C> RefUnwindSafe for GcHandle<T, C> where
    T: RefUnwindSafe,
    <<C as RawCollectorImpl>::Ptr as CollectorPtr<C>>::Weak: RefUnwindSafe

impl<T, C> Unpin for GcHandle<T, C> where
    <<C as RawCollectorImpl>::Ptr as CollectorPtr<C>>::Weak: Unpin

impl<T, C> UnwindSafe for GcHandle<T, C> where
    T: RefUnwindSafe,
    <<C as RawCollectorImpl>::Ptr as CollectorPtr<C>>::Weak: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]