Skip to main content

Strategy

Trait Strategy 

Source
pub trait Strategy
where Self: Sized,
{ // Required methods fn new_unit_count() -> (Self, usize); fn with_unit_count(unit_count: usize) -> Self; fn add<Container: Static>( &mut self, units: &mut Vec<Option<Container>>, container: Container, ); }
Expand description

A dynamization strategy.

Can be simply a ZST. Also can contain some internal bookkeeping machinery.

Required Methods§

Source

fn new_unit_count() -> (Self, usize)

A default strategy with a default initial unit count.

Source

fn with_unit_count(unit_count: usize) -> Self

A strategy with a specified initial unit count.

Source

fn add<Container: Static>( &mut self, units: &mut Vec<Option<Container>>, container: Container, )

An algorithm for adding a new unit.

Can modify an internal state of the strategy.

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.

Implementors§