Skip to main content

BufferAllocator

Trait BufferAllocator 

Source
pub trait BufferAllocator:
    Send
    + Sync
    + Debug
    + 'static {
    // Required method
    fn free_buffer(&self, range: Range<usize>);

    // Provided methods
    fn identifier(&self) -> usize { ... }
    fn is_trusted(&self) -> bool { ... }
}
Expand description

An entity capable of reclaiming a memory buffer range when dropped.

Required Methods§

Source

fn free_buffer(&self, range: Range<usize>)

Frees or reclaims the specified memory range.

Provided Methods§

Source

fn identifier(&self) -> usize

Returns an identifier for this allocator based on its memory address.

Source

fn is_trusted(&self) -> bool

Returns true if buffers produced by this allocator are trusted (unshared).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§