[][src]Struct stakker::PipedLink

pub struct PipedLink<O: Send + Sync + 'static, I: Send + Sync + 'static> { /* fields omitted */ }

Link from a PipedThread thread back to the main thread

Methods

impl<O: Send + Sync + 'static, I: Send + Sync + 'static> PipedLink<O, I>[src]

pub fn send(&mut self, msg: I) -> bool[src]

Send a message back to the main thread. Returns true on success. If false is returned, then the PipedThread has been dropped and this thread should terminate itself.

pub fn recv(&mut self) -> Option<O>[src]

Receive a message from the main thread. Blocks if there is no message already waiting. Returns None if the PipedThread has been dropped, in which case this thread should terminate itself.

pub fn cancel(&mut self) -> bool[src]

Check whether cancellation has been flagged by the main thread. When the PipedThread is dropped, the cancel flag is set to tell this thread to terminate. If the thread is doing a long-running operation or blocking, it should check the cancel flag from time to time to recognise this condition and to clean up in good time.

Auto Trait Implementations

impl<O, I> !RefUnwindSafe for PipedLink<O, I>

impl<O, I> Send for PipedLink<O, I>

impl<O, I> Sync for PipedLink<O, I>

impl<O, I> Unpin for PipedLink<O, I>

impl<O, I> !UnwindSafe for PipedLink<O, I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any
[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, U> Into<U> for T where
    U: From<T>, 
[src]

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.