Struct market::io::Reader[][src]

pub struct Reader<G: AssembleFrom<u8>> { /* fields omitted */ }

Consumes goods of type G assembled from bytes read by a Read trait object.

Because Read::read() does not provide any guarantees about blocking, the read is executed in a separate thread which produces the read bytes. The current thread attempts to assemble the consumed bytes into a good.

Implementations

impl<G: AssembleFrom<u8>> Reader<G>[src]

pub fn new<R>(description: String, mut reader: R) -> Self where
    R: Read + RefUnwindSafe + Send + 'static, 
[src]

Creates a new Reader with reader.

pub fn cancel(&self)[src]

Requests that the thread be canceled.

Trait Implementations

impl<G: AssembleFrom<u8>> Consumer for Reader<G> where
    <G as AssembleFrom<u8>>::Error: TryFrom<ConsumeFailure<<G as AssembleFrom<u8>>::Error>>, 
[src]

type Good = G

The item being consumed.

type Failure = ConsumeFailure<ReadFault<G>>

Describes a failure to successfully complete consumption.

impl<G: Debug + AssembleFrom<u8>> Debug for Reader<G>[src]

Auto Trait Implementations

impl<G> !RefUnwindSafe for Reader<G>[src]

impl<G> Send for Reader<G> where
    G: Send
[src]

impl<G> !Sync for Reader<G>[src]

impl<G> Unpin for Reader<G> where
    G: Unpin
[src]

impl<G> !UnwindSafe for Reader<G>[src]

Blanket Implementations

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

impl<P, C> AssembleInto<C> for P where
    C: AssembleFrom<P>, 
[src]

type Error = <C as AssembleFrom<P>>::Error

Describes an error with the parts. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<P, C> DisassembleInto<P> for C where
    P: DisassembleFrom<C>, 
[src]

type Error = <P as DisassembleFrom<C>>::Error

Describes an error that prevents disassembly.

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.