[][src]Struct fast_threadpool::ThreadPoolSyncHandler

pub struct ThreadPoolSyncHandler<Shared: 'static + Clone + Send> { /* fields omitted */ }

Synchronous handler to execute jobs on the thread pool

Implementations

impl<Shared: 'static + Clone + Send> ThreadPoolSyncHandler<Shared>[src]

pub fn execute<F, R>(&self, f: F) -> Result<R, ThreadPoolDisconnected> where
    F: 'static + Send + FnOnce(&Shared) -> R,
    R: 'static + Send
[src]

Execute the given job and block the current thread until finished. If you need a non blocking method, see ThreadPoolAsyncHandler.

pub fn launch<F, R>(
    &self,
    f: F
) -> Result<JoinHandle<R>, ThreadPoolDisconnected> where
    F: 'static + Send + FnOnce(&Shared) -> R,
    R: 'static + Send
[src]

Launch the given job and return a oneshot receiver that listen job result. If you need a non blocking method, see ThreadPoolAsyncHandler.

Trait Implementations

impl<Shared: Clone + 'static + Send> Clone for ThreadPoolSyncHandler<Shared>[src]

impl<Shared: Debug + 'static + Clone + Send> Debug for ThreadPoolSyncHandler<Shared>[src]

Auto Trait Implementations

impl<Shared> !RefUnwindSafe for ThreadPoolSyncHandler<Shared>[src]

impl<Shared> Send for ThreadPoolSyncHandler<Shared>[src]

impl<Shared> Sync for ThreadPoolSyncHandler<Shared>[src]

impl<Shared> Unpin for ThreadPoolSyncHandler<Shared>[src]

impl<Shared> !UnwindSafe for ThreadPoolSyncHandler<Shared>[src]

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.