Struct agnostic_async_executor::AgnosticExecutor [−][src]
An executor that can spawn futures. This can be freely stored anywhere you need, cloned, and be sent to other threads.
Implementations
impl AgnosticExecutor
[src]
pub fn spawn<F, T>(&self, future: F) -> JoinHandle<T>ⓘNotable traits for JoinHandle<T>
impl<T: 'static> Future for JoinHandle<T> type Output = T;
where
F: Future<Output = T> + Send + 'static,
T: Send + 'static,
[src]
Notable traits for JoinHandle<T>
impl<T: 'static> Future for JoinHandle<T> type Output = T;
F: Future<Output = T> + Send + 'static,
T: Send + 'static,
Spawns a future on this executor.
pub fn spawn_blocking<F, T>(&self, task: F) -> JoinHandle<T>ⓘNotable traits for JoinHandle<T>
impl<T: 'static> Future for JoinHandle<T> type Output = T;
where
F: FnOnce() -> T + Send + 'static,
T: Send + 'static,
[src]
Notable traits for JoinHandle<T>
impl<T: 'static> Future for JoinHandle<T> type Output = T;
F: FnOnce() -> T + Send + 'static,
T: Send + 'static,
Runs the provided closure, and when possible, it does it in a way that doesn't block concurrent tasks.
impl AgnosticExecutor
[src]
pub async fn sleep(&self, duration: Duration)
[src]
Returns a future that sleeps for a duration.
pub async fn sleep_millis(&self, duration: u64)
[src]
Returns a future that sleeps for a duration in milliseconds.
pub async fn timeout<T: Future>(
&self,
duration: Duration,
future: T
) -> Result<T::Output, TimedOut>
[src]
&self,
duration: Duration,
future: T
) -> Result<T::Output, TimedOut>
Wraps a future in a timeout that expires after a duration if the provided future didn't finish.
pub async fn timeout_millis<T: Future>(
&self,
duration: u64,
future: T
) -> Result<T::Output, TimedOut>
[src]
&self,
duration: u64,
future: T
) -> Result<T::Output, TimedOut>
Wraps a future in a timeout that expires after a duration in milliseconds if the provided future didn't finish.
pub fn interval(&self, duration: Duration) -> Interval
[src]
Creates a new Interval for a given duration.
pub fn interval_millis(&self, duration: u64) -> Interval
[src]
Creates a new Interval for a given duration in milliseconds.
Trait Implementations
impl Clone for AgnosticExecutor
[src]
fn clone(&self) -> AgnosticExecutor
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AgnosticExecutor
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AgnosticExecutor
[src]
impl Send for AgnosticExecutor
[src]
impl Sync for AgnosticExecutor
[src]
impl Unpin for AgnosticExecutor
[src]
impl !UnwindSafe for AgnosticExecutor
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,