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/!Sync 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 AllocationToken. 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

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.