[][src]Enum dynpool::Scale

pub enum Scale {
    Shutdown,
    Active(usize),
    Mixed {
        active: usize,
        max_inactive: usize,
    },
    NoTerm {
        active: usize,
    },
}

A goal for the worker pool. This describes the scale that the pool should attempt to reach.

Variants

Shutdown

Shutdown the pool.

Active(usize)

Maintain the given number of active workers. Inactive worker threads are shutdown.

Mixed

Maintain the given number of active workers, and up to the given number of inactive workers. Any extra inactive worker threads are shutdown.

Fields of Mixed

active: usize

Number of active workers.

max_inactive: usize

Maximum number of inactive worker.

NoTerm

Maintain the given number of active workers, and an unlimited number of inactive workers. No worker threads will be terminated unless one panics.

Fields of NoTerm

active: usize

Number of active workers.

Methods

impl Scale[src]

pub fn shutdown() -> Scale[src]

Shutdown the pool.

pub fn active(num: usize) -> Scale[src]

Scale to exactly the given number of workers.

pub fn mixed(active: usize, max_inactive: usize) -> Scale[src]

Scale to the given number of active workers and no more than the given number of inactive workers.

pub fn no_term(active: usize) -> Scale[src]

Scale to the given number of active workers without shutting down any inactive workers.

pub fn worker_count(self) -> usize[src]

How many active workers should the pool scale to?

Trait Implementations

impl Clone for Scale[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for Scale[src]

impl Debug for Scale[src]

Auto Trait Implementations

impl Send for Scale

impl Unpin for Scale

impl Sync for Scale

impl RefUnwindSafe for Scale

impl UnwindSafe for Scale

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]