pub enum Effect {
Pure,
Faults,
Allocates,
AllocatesAndFaults,
}Expand description
The one answer to “does calling this need a root set, or a fault check?”
Allocates means the call may trigger a collection, so every live
GcRef the caller holds must be rooted across it — that is what makes a
call site a safepoint. A wrapper that only hands back an immortal singleton
(true, false, unit) allocates nothing collectable and is therefore not
a safepoint, however “alloc” its name reads.
Variants§
Pure
Neither allocates nor faults.
Faults
May set a pending fault; cannot allocate.
Allocates
May allocate (and therefore collect); cannot fault.
AllocatesAndFaults
Both.
Implementations§
Trait Implementations§
impl Copy for Effect
impl Eq for Effect
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
impl UnwindSafe for Effect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more