Struct pendulum::HashedWheelBuilder
[−]
[src]
pub struct HashedWheelBuilder { /* fields omitted */ }
Builder for configuring different options for a HashedWheel
.
Methods
impl HashedWheelBuilder
[src]
fn with_tick_duration(self, duration: Duration) -> HashedWheelBuilder
[src]
Sets the tick duration which sets the resolution for the timer.
Any timeouts will be rounded up based on the tick duration.
fn with_num_slots(self, num_slots: usize) -> HashedWheelBuilder
[src]
Sets the number of slots used for ticks.
Controls how many slots we have for timeouts. The less number of collisions there are (where a collision is when two or more items in the same slot have different timeouts), the more efficient operations we can perform.
fn with_init_capacity(self, init_capacity: usize) -> HashedWheelBuilder
[src]
Sets the initial capacity for timer storage.
This is the number of timeouts we can initially store.
fn with_max_capacity(self, max_capacity: usize) -> HashedWheelBuilder
[src]
Sets the maximum capacity for timer storage.
This is the maximum number of timeouts we can ever store.
fn with_max_timeout(self, timeout: Duration) -> HashedWheelBuilder
[src]
Sets the maximum timeout for any timer.
Defaults to tick_duration * num_slots
.
fn tick_duration(&self) -> Duration
[src]
Get the tick duration that was set.
fn num_slots(&self) -> usize
[src]
Get the number of slots that were set.
fn init_capacity(&self) -> usize
[src]
Get the initial capacity for timer storage that was set.
fn max_capacity(&self) -> usize
[src]
Get the maximum capacity for timer storage that was set.
fn max_timeout(&self) -> Duration
[src]
Get the maximum timeout that was set.
fn build<T>(self) -> HashedWheel<T>
[src]
Build a new HashedWheel
from the current builder.
Trait Implementations
impl Default for HashedWheelBuilder
[src]
fn default() -> HashedWheelBuilder
[src]
Returns the "default value" for a type. Read more