Pool

Struct Pool 

Source
pub struct Pool { /* private fields */ }
Expand description

A pool for delayed edges. Pools are scoped to a State. Edges within a State will share Pools. A Pool will keep a count of the total ‘weight’ of the currently scheduled edges. If a Plan attempts to schedule an Edge which would cause the total weight to exceed the depth of the Pool, the Pool will enque the Edge instead of allowing the Plan to schedule it. The Pool will relinquish queued Edges when the total scheduled weight diminishes enough (i.e. when a scheduled edge completes).

Implementations§

Source§

impl Pool

Source

pub fn new(name: Vec<u8>, depth: usize) -> Self

Source

pub fn is_valid(&self) -> bool

Source

pub fn depth(&self) -> usize

Source

pub fn name(&self) -> &[u8]

Source

pub fn current_use(&self) -> usize

Source

pub fn should_delay_edge(&self) -> bool

true if the Pool might delay this edge

Source

pub fn delay_edge(&mut self, state: &State, edge: EdgeIndex)

adds the given edge to this Pool to be delayed.

Source

pub fn retrieve_ready_edges( &mut self, state: &State, ready_queue: &mut BTreeSet<EdgeIndex>, )

Pool will add zero or more edges to the ready_queue

Source

pub fn edge_scheduled(&mut self, state: &State, edge: EdgeIndex)

informs this Pool that the given edge is committed to be run. Pool will count this edge as using resources from this pool.

Source

pub fn edge_finished(&mut self, state: &State, edge: EdgeIndex)

informs this Pool that the given edge is no longer runnable, and should relinquish its resources back to the pool

Auto Trait Implementations§

§

impl Freeze for Pool

§

impl RefUnwindSafe for Pool

§

impl Send for Pool

§

impl Sync for Pool

§

impl Unpin for Pool

§

impl UnwindSafe for Pool

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.