pub trait SpillAlloc<'a>: Sized {
type NewIn<A: 'a>;
// Required method
fn spill_alloc_in<A: Allocator + 'a>(self, alloc: A) -> Self::NewIn<A>;
// Provided method
fn spill_alloc(self) -> Self::NewIn<Global> { ... }
}
Expand description
Attach an allocator to a fixed allocation buffer. Once the initial buffer is exhausted, additional buffer(s) may be requested from the new allocator instance.
Required Associated Types§
Required Methods§
Sourcefn spill_alloc_in<A: Allocator + 'a>(self, alloc: A) -> Self::NewIn<A>
fn spill_alloc_in<A: Allocator + 'a>(self, alloc: A) -> Self::NewIn<A>
Consume the allocator instance, returning a new allocator
which spills into the provided allocator instance alloc
.
Provided Methods§
Sourcefn spill_alloc(self) -> Self::NewIn<Global>
fn spill_alloc(self) -> Self::NewIn<Global>
Consume the allocator instance, returning a new allocator which spills into the Global allocator.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.