Struct market::thread::Thread [−][src]
A wrapper around the std::thread
functionality.
Consumes the status of running the given closure. Thus, consumption replaces the functionality of std::thread::JoinHandle::join()
.
Implementations
impl<S: Send + 'static, E: TryFrom<ConsumeFailure<E>> + Send + 'static> Thread<S, E>
[src]
pub fn new<P: Send + 'static, F: FnMut(&mut P) -> Result<S, E> + RefUnwindSafe + Send + 'static>(
name: String,
kind: Kind,
mut parameters: P,
mut call: F
) -> Self
[src]
name: String,
kind: Kind,
mut parameters: P,
mut call: F
) -> Self
Creates a new Thread
and spawns call
.
pub fn cancel(&self)
[src]
Requests that self
be canceled.
Trait Implementations
impl<S, E: TryFrom<ConsumeFailure<E>>> Consumer for Thread<S, E>
[src]
type Good = S
The item being consumed.
type Failure = ConsumeFailure<E>
Describes a failure to successfully complete consumption.
fn consume(&self) -> Result<Self::Good, Self::Failure>
[src]
fn goods(&self) -> Goods<'_, Self>ⓘ where
Self: Sized,
[src]
Self: Sized,
fn demand(&self) -> Result<Self::Good, <Self::Failure as Failure>::Fault>
[src]
impl<S: Debug, E: Debug> Debug for Thread<S, E>
[src]
Auto Trait Implementations
impl<S, E> !RefUnwindSafe for Thread<S, E>
[src]
impl<S, E> Send for Thread<S, E> where
E: Send,
S: Send,
[src]
E: Send,
S: Send,
impl<S, E> Sync for Thread<S, E> where
E: Send,
S: Send,
[src]
E: Send,
S: Send,
impl<S, E> Unpin for Thread<S, E>
[src]
impl<S, E> !UnwindSafe for Thread<S, E>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<P, C> AssembleInto<C> for P where
C: AssembleFrom<P>,
[src]
C: AssembleFrom<P>,
type Error = <C as AssembleFrom<P>>::Error
Describes an error with the parts. Read more
pub fn assemble_into(
parts: &mut Vec<P, Global>
) -> Result<C, AssembleFailure<<P as AssembleInto<C>>::Error>>
[src]
parts: &mut Vec<P, Global>
) -> Result<C, AssembleFailure<<P as AssembleInto<C>>::Error>>
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<P, C> DisassembleInto<P> for C where
P: DisassembleFrom<C>,
[src]
P: DisassembleFrom<C>,
type Error = <P as DisassembleFrom<C>>::Error
Describes an error that prevents disassembly.
pub fn disassemble_into(
self
) -> Result<Vec<P, Global>, <C as DisassembleInto<P>>::Error>
[src]
self
) -> Result<Vec<P, Global>, <C as DisassembleInto<P>>::Error>
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,