SimpleResultReceiver

Struct SimpleResultReceiver 

Source
pub struct SimpleResultReceiver<S: SimpleSpawner<R>, R: Debug> { /* private fields */ }
Expand description

Uses a future to receive the result.

Implementations§

Source§

impl<S, R> SimpleResultReceiver<S, R>
where S: SimpleSpawner<R>, R: Debug + Send + Sync + 'static,

Source

pub fn new<F>(spawner: &S, task: F) -> Self
where F: Future<Output = R> + Send + 'static,

Trait Implementations§

Source§

impl<S: Debug + SimpleSpawner<R>, R: Debug + Debug> Debug for SimpleResultReceiver<S, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S, R> ResultReceiver for SimpleResultReceiver<S, R>
where S: SimpleSpawner<R>, <S as SimpleSpawner<R>>::Future: Unpin, R: Debug + Send + Sync + 'static,

Source§

type Result = R

Source§

fn done(&self) -> bool

Check if the result is ready.
Source§

fn try_get(&mut self) -> Option<Result<Self::Result, ResultError>>

Try to get the result. Read more
Source§

fn get<'async_trait>( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<Self::Result, ResultError>> + Send + 'async_trait>>
where Self: 'async_trait,

Consume self to get the result. Read more

Auto Trait Implementations§

§

impl<S, R> Freeze for SimpleResultReceiver<S, R>
where <S as SimpleSpawner<R>>::Future: Freeze, R: Freeze, <S as SimpleSpawner<R>>::Error: Freeze,

§

impl<S, R> RefUnwindSafe for SimpleResultReceiver<S, R>

§

impl<S, R> Send for SimpleResultReceiver<S, R>
where R: Send,

§

impl<S, R> Sync for SimpleResultReceiver<S, R>
where <S as SimpleSpawner<R>>::Future: Sync, R: Sync, <S as SimpleSpawner<R>>::Error: Sync,

§

impl<S, R> Unpin for SimpleResultReceiver<S, R>
where <S as SimpleSpawner<R>>::Future: Unpin,

§

impl<S, R> UnwindSafe for SimpleResultReceiver<S, R>

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

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.