[−][src]Struct scoped_gc::GcScope
Defines a scope for garbage collection.
It lets you allocate garbage-collected values. They can have cycles. Their reachability is tracked so they can be deallocated once unreachable. All the values are deallocated once the scope is dropped.
Methods
impl<'gc> GcScope<'gc>
[src]
pub fn new() -> GcScope<'gc>
[src]
pub fn alloc<T: Trace + 'gc>(
&'gc self,
value: T
) -> Result<Gc<'gc, T>, GcAllocErr>
[src]
&'gc self,
value: T
) -> Result<Gc<'gc, T>, GcAllocErr>
Allocates value
in this garbage-collected scope and returns a Gc
smart pointer to it.
pub fn collect_garbage(&self)
[src]
Trait Implementations
Auto Trait Implementations
impl<'gc> !Sync for GcScope<'gc>
impl<'gc> !Send for GcScope<'gc>
impl<'gc> !Unpin for GcScope<'gc>
impl<'gc> !RefUnwindSafe for GcScope<'gc>
impl<'gc> !UnwindSafe for GcScope<'gc>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,