[−][src]Struct smartpool::scoped::Scope
A handle to a batch of scoped operations, which allow non-static futures to be wrapped into static futures, which prevent this the batch stack frame from exiting until they complete.
Methods
impl<'env> Scope<'env>
[src]
#[must_use]
pub fn wrap<'scope, F: Future<Item = (), Error = ()> + Send + 'env>(
&'scope self,
future_factory: impl FnOnce() -> F
) -> Box<dyn Future<Item = (), Error = ()> + Send + 'static>
[src]
#[must_use]
pub fn wrap<'scope, F: Future<Item = (), Error = ()> + Send + 'env>(&'scope self,
future_factory: impl FnOnce() -> F
) -> Box<dyn Future<Item = (), Error = ()> + Send + 'static>
Wrap a non-static future into a static-future (which will block this scoped batch stack frame), allowing that future to be submitted to a threadpool.
#[must_use]
pub fn work<'scope>(
&'scope self,
work: impl FnOnce() + Send + 'env
) -> Box<dyn Future<Item = (), Error = ()> + Send + 'static>
[src]
#[must_use]
pub fn work<'scope>(&'scope self,
work: impl FnOnce() + Send + 'env
) -> Box<dyn Future<Item = (), Error = ()> + Send + 'static>
A convenience utility for wrapping some pure, non-blocking work.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,