Skip to main content

Blocking

Struct Blocking 

Source
pub struct Blocking<'rt, R: ?Sized, W, Out> { /* private fields */ }
Expand description

Payload bound to thread-occupying work.

Implementations§

Source§

impl<'rt, R, W, Out> Blocking<'rt, R, W, Out>
where R: Runtime + ?Sized, Out: Send + 'static, W: FnOnce() -> Result<Out, ProximaError> + Send + 'static,

Source

pub fn spawn(self) -> impl Future<Output = Result<Out, ProximaError>> + Send

Hand the work to the background pool. The Box<dyn Any> round trip the object-safe trait requires is paid here, once, so the caller gets Out.

Auto Trait Implementations§

§

impl<'rt, R, W, Out> Freeze for Blocking<'rt, R, W, Out>
where &'rt R: Freeze, W: Freeze, PhantomData<fn() -> Out>: Freeze, R: ?Sized,

§

impl<'rt, R, W, Out> RefUnwindSafe for Blocking<'rt, R, W, Out>

§

impl<'rt, R, W, Out> Send for Blocking<'rt, R, W, Out>
where &'rt R: Send, W: Send, PhantomData<fn() -> Out>: Send, R: ?Sized,

§

impl<'rt, R, W, Out> Sync for Blocking<'rt, R, W, Out>
where &'rt R: Sync, W: Sync, PhantomData<fn() -> Out>: Sync, R: ?Sized,

§

impl<'rt, R, W, Out> Unpin for Blocking<'rt, R, W, Out>
where &'rt R: Unpin, W: Unpin, PhantomData<fn() -> Out>: Unpin, R: ?Sized,

§

impl<'rt, R, W, Out> UnsafeUnpin for Blocking<'rt, R, W, Out>

§

impl<'rt, R, W, Out> UnwindSafe for Blocking<'rt, R, W, Out>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.