Trait rubble::link::queue::Consumer [−][src]
pub trait Consumer {
fn has_data(&self) -> bool;
fn consume_raw_with<R>(
&mut self,
f: impl FnOnce(Header, &[u8]) -> Consume<R>
) -> Result<R, Error>;
fn consume_pdu_with<R>(
&mut self,
f: impl FnOnce(Header, Pdu<'_, &[u8]>) -> Consume<R>
) -> Result<R, Error> { ... }
}
Expand description
The consuming (reading) half of a packet queue.
Required methods
Passes the next raw packet in the queue to a closure.
The closure returns a Consume
value to indicate whether the packet should remain in the
queue or be removed.
If the queue is empty, Error::Eof
is returned.
Provided methods
Passes the next packet in the queue to a closure.
The closure returns a Consume
value to indicate whether the packet should remain in the
queue or be removed.
If the queue is empty, Error::Eof
is returned.