pub trait AtlasAllocator {
type Parameters;
// Required methods
fn new(size: i32, parameters: &Self::Parameters) -> Self;
fn allocate(
&mut self,
size: DeviceIntSize,
) -> Option<(AllocId, DeviceIntRect)>;
fn deallocate(&mut self, id: AllocId);
fn is_empty(&self) -> bool;
fn allocated_space(&self) -> i32;
fn dump_into_svg(
&self,
rect: &Box2D<f32>,
output: &mut dyn Write,
) -> Result<()>;
}Required Associated Types§
Sourcetype Parameters
type Parameters
Specific parameters of the allocator.
Required Methods§
Sourcefn new(size: i32, parameters: &Self::Parameters) -> Self
fn new(size: i32, parameters: &Self::Parameters) -> Self
Constructor
Sourcefn allocate(&mut self, size: DeviceIntSize) -> Option<(AllocId, DeviceIntRect)>
fn allocate(&mut self, size: DeviceIntSize) -> Option<(AllocId, DeviceIntRect)>
Allocate a rectangle.
Sourcefn deallocate(&mut self, id: AllocId)
fn deallocate(&mut self, id: AllocId)
Deallocate a rectangle and return its size.
Sourcefn allocated_space(&self) -> i32
fn allocated_space(&self) -> i32
Allocated area in pixels.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".