Struct tracking_allocator::AllocationGroupToken[][src]

pub struct AllocationGroupToken(_);
Expand description

A token that uniquely identifies an allocation group.

Implementations

Acquires an allocation group token.

Acquires an allocation group token, with tags.

While allocation groups are primarily represented by their AllocationGroupToken, users can use this method to attach specific tags – or key/value string pairs – to the group. These tags will be provided to the global tracker whenever an allocation event is associated with the allocation group.

Memory usage

In order to minimize any allocations while in the process of tracking normal allocations, we rely on utilizing only static references to data. If the tags given are not already 'static references, they will be leaked in order to make them 'static. Thus, callers should take care to avoid registering tokens on an ongoing basis when utilizing owned tags as this could create a persistent and ever-growing memory leak over the life of the process.

Marks the associated allocation group as the active allocation group on this thread.

If another allocation group is currently active, it is replaced, and restored either when this allocation guard is dropped, or when AllocationGuard::exit is called.

Attaches this allocation group to a tracing span.

When the span is entered or exited, the allocation group will also transition from idle to active, creating the beavhior of associating all allocations within the during of the entered span with the given allocation group.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

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