Struct tracking_allocator::AllocationGuard [−][src]
pub struct AllocationGuard { /* fields omitted */ }Expand description
Guard that updates the current thread to track allocations for the associated allocation group.
Drop behavior
This guard has a Drop implementation that resets the active allocation group back to the
previous allocation group.
Moving across threads
AllocationGuard is specifically marked as !Send as the active allocation group is tracked
at a per-thread level. If you acquire an AllocationGuard and need to resume computation on
another thread, such as across an await point or when simply sending objects to another thread,
you must first exit the guard and move the resulting AllocationGroupToken. Once
on the new thread, you can then reacquire the guard.
Implementations
Unmarks this allocation group as the active allocation group on this thread, resetting the active allocation group to the previous value.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AllocationGuard
impl !Send for AllocationGuard
impl Sync for AllocationGuard
impl Unpin for AllocationGuard
impl UnwindSafe for AllocationGuard
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more