pub struct SpanPool { /* private fields */ }Expand description
Memory pool for span allocations
Implementations§
Source§impl SpanPool
impl SpanPool
Sourcepub fn new(config: SpanPoolConfig) -> Self
pub fn new(config: SpanPoolConfig) -> Self
Create a new span pool with the given configuration
Sourcepub fn acquire(&mut self) -> PooledSpan
pub fn acquire(&mut self) -> PooledSpan
Acquire a span from the pool
If the pool is empty, allocates a new span (automatic growth). If pooling is disabled, always allocates a new span.
Sourcepub fn release(&mut self, span: PooledSpan)
pub fn release(&mut self, span: PooledSpan)
Release a span back to the pool
If pooling is disabled, the span is simply dropped.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if the pool is enabled
Auto Trait Implementations§
impl !Freeze for SpanPool
impl RefUnwindSafe for SpanPool
impl Send for SpanPool
impl Sync for SpanPool
impl Unpin for SpanPool
impl UnsafeUnpin for SpanPool
impl UnwindSafe for SpanPool
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