Struct market::io::Reader [−][src]
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]
R: Read + RefUnwindSafe + Send + 'static,
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]
<G as AssembleFrom<u8>>::Error: TryFrom<ConsumeFailure<<G as AssembleFrom<u8>>::Error>>,
type Good = G
The item being consumed.
type Failure = ConsumeFailure<ReadFault<G>>
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<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]
G: Send,
impl<G> !Sync for Reader<G>
[src]
impl<G> Unpin for Reader<G> where
G: Unpin,
[src]
G: Unpin,
impl<G> !UnwindSafe for Reader<G>
[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>,