Struct brotli::enc::worker_pool::WorkerPool

source ·
pub struct WorkerPool<ReturnValue: Send + 'static, ExtraInput: Send + 'static, Alloc: BrotliAlloc + Send + 'static, U: Send + 'static + Sync> {
    queue: GuardedQueue<ReturnValue, ExtraInput, Alloc, U>,
    join: [Option<JoinHandle<()>>; 16],
}

Fields§

§queue: GuardedQueue<ReturnValue, ExtraInput, Alloc, U>§join: [Option<JoinHandle<()>>; 16]

Implementations§

source§

impl<ReturnValue: Send + 'static, ExtraInput: Send + 'static, Alloc: BrotliAlloc + Send + 'static, U: Send + 'static + Sync> WorkerPool<ReturnValue, ExtraInput, Alloc, U>

source

fn do_work( queue: Arc<(Mutex<WorkQueue<ReturnValue, ExtraInput, Alloc, U>>, Condvar)>, )

source

fn _push_job(&mut self, job: JobRequest<ReturnValue, ExtraInput, Alloc, U>)

source

fn _try_push_job( &mut self, job: JobRequest<ReturnValue, ExtraInput, Alloc, U>, ) -> Result<(), JobRequest<ReturnValue, ExtraInput, Alloc, U>>

source

fn start( queue: Arc<(Mutex<WorkQueue<ReturnValue, ExtraInput, Alloc, U>>, Condvar)>, ) -> JoinHandle<()>

source

pub fn new(num_threads: usize) -> Self

Trait Implementations§

source§

impl<ReturnValue: Send + 'static, ExtraInput: Send + 'static, Alloc: BrotliAlloc + Send + 'static, U: Send + 'static + Sync> BatchSpawnableLite<ReturnValue, ExtraInput, Alloc, U> for WorkerPool<ReturnValue, ExtraInput, Alloc, U>
where <Alloc as Allocator<u8>>::AllocatedMemory: Send + 'static, <Alloc as Allocator<u16>>::AllocatedMemory: Send + Sync, <Alloc as Allocator<u32>>::AllocatedMemory: Send + Sync,

§

type FinalJoinHandle = Arc<RwLock<U>>

§

type JoinHandle = WorkerJoinable<ReturnValue, ExtraInput, Alloc, U>

source§

fn make_spawner(&mut self, input: &mut Owned<U>) -> Self::FinalJoinHandle

source§

fn spawn( &mut self, locked_input: &mut Self::FinalJoinHandle, work: &mut SendAlloc<ReturnValue, ExtraInput, Alloc, Self::JoinHandle>, index: usize, num_threads: usize, f: fn(_: ExtraInput, _: usize, _: usize, _: &U, _: Alloc) -> ReturnValue, )

source§

impl<ReturnValue: Send + 'static, ExtraInput: Send + 'static, Alloc: BrotliAlloc + Send + 'static, U: Send + 'static + Sync> Drop for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<ReturnValue, ExtraInput, Alloc, U> Freeze for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

§

impl<ReturnValue, ExtraInput, Alloc, U> !RefUnwindSafe for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

§

impl<ReturnValue, ExtraInput, Alloc, U> Send for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

§

impl<ReturnValue, ExtraInput, Alloc, U> Sync for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

§

impl<ReturnValue, ExtraInput, Alloc, U> Unpin for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

§

impl<ReturnValue, ExtraInput, Alloc, U> !UnwindSafe for WorkerPool<ReturnValue, ExtraInput, Alloc, U>

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>,

§

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>,

§

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.