[][src]Struct buttplug::util::future::ButtplugFutureStateShared

pub struct ButtplugFutureStateShared<T> { /* fields omitted */ }

Shared ButtplugFutureState type.

ButtplugFutureState is made to be shared across tasks, and we'll never know if those tasks are running on single or multithreaded executors.

Panics and notes on setting replies

The lock for a ButtplugFutureState should only ever be taken when the reply is being set (which the set_reply method does internally), and there should never be a point where the reply is set twice (See the panic documentation for ButtplugFutureState). In order to make sure we never block, we always lock using try_lock with .expect(). If try_lock fails, this means we're already in a double reply situation, and therefore we'll panic on the .expect(). Any panic from this should be considered a library error and reported as a bug.

Implementations

impl<T> ButtplugFutureStateShared<T>[src]

pub fn new(state: ButtplugFutureState<T>) -> Self[src]

pub fn set_reply(&self, reply: T)[src]

Locks immediately and sets the reply for the internal waker, or panics if lock is held.

See ButtplugFutureStateShared struct documentation for more info on locking.

Trait Implementations

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

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

impl<T> Default for ButtplugFutureStateShared<T>[src]

impl<T> Send for ButtplugFutureStateShared<T>[src]

impl<T> Sync for ButtplugFutureStateShared<T>[src]

Auto Trait Implementations

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

impl<T> GetTypeId for T where
    T: Any
[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]