pub trait MemoryBounds {
// Required method
fn specify_bounds(&self, builder: &mut MemoryBoundsBuilder<'_>);
}
Expand description
Memory bounds for a component.
Components will naturally allocate memory in many phases, from initialization to normal operation. In some cases, these allocations can be unbounded, leading to potential memory exhaustion.
When a component has a way to bound its memory usage, it can implement this trait to provide that accounting. A bounds builder exposes a simple interface for tallying up the memory usage of individual pieces of a component, such as buffers and buffer pools, containers, and more.
Required Methods§
Sourcefn specify_bounds(&self, builder: &mut MemoryBoundsBuilder<'_>)
fn specify_bounds(&self, builder: &mut MemoryBoundsBuilder<'_>)
Specifies the minimum and firm memory bounds for this component and its subcomponents.