Collectable

Trait Collectable 

Source
pub trait Collectable:
    Trace
    + MapAs
    + Send
    + Sync
    + 'static { }
Expand description

A type that can be garbage collected.

A type needs to implement both Trace and MapAs to be collectable.

If a type can’t contain any Ref<T>s and no mapping functionality is desired, the SimpleType trait can be implemented instead of Trace and MapAs to enable collection.

If a type can’t contain any Ref<T>s, ContainsNoRefs can be implemented instead of Trace.

If no mapping functionality is desired, NoMapping can be implemented instead of MapAs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Collectable for T
where T: Trace + MapAs + Send + Sync + 'static,