Struct hotdrink_rs::model::Activation[][src]

pub struct Activation<T> {
    pub inner: Arc<Mutex<ActivationInner<T>>>,
    pub producer: Option<TerminationHandle>,
}

Represents a value that may not be done being computed. Once the value has been computed, it will be stored in its shared state. Should be used as a Future, and can be awaited in async code.

Fields

inner: Arc<Mutex<ActivationInner<T>>>

A slot for the data once it arrives, as well as the waker to call once a result has been produced.

producer: Option<TerminationHandle>

A reference to the thread that is producing the result. Dropping this tells the worker that this value no longer requires the outputs of the computation.

Implementations

impl<T> Activation<T>[src]

pub fn inner(&self) -> &Arc<Mutex<ActivationInner<T>>>[src]

Returns a reference to the shared state of this variable activation.

pub fn cancel(&mut self, e: SolveError)[src]

Marks this activation for cancellation.

Trait Implementations

impl<T> Clone for Activation<T>[src]

impl<T: Debug> Debug for Activation<T>[src]

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

impl<T> Future for Activation<T>[src]

type Output = Value<T>

The type of value produced on completion.

impl<T: PartialEq> PartialEq<Activation<T>> for Activation<T>[src]

fn eq(&self, other: &Self) -> bool[src]

TODO: Avoid deadlocks here?

Auto Trait Implementations

impl<T> RefUnwindSafe for Activation<T>

impl<T> Send for Activation<T> where
    T: Send + Sync

impl<T> Sync for Activation<T> where
    T: Send + Sync

impl<T> Unpin for Activation<T>

impl<T> UnwindSafe for Activation<T>

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<!> for T[src]

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

impl<T> FutureExt for T where
    T: Future + ?Sized

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

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized

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.