[−][src]Struct buttplug::util::future::ButtplugFutureStateShared
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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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
impl<T> RefUnwindSafe for ButtplugFutureStateShared<T>
impl<T> Unpin for ButtplugFutureStateShared<T>
impl<T> UnwindSafe for ButtplugFutureStateShared<T>
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,