Struct bytecodec::combinator::Peekable [−][src]
Combinator that enables to peek decoded items before calling finish_decoding method.
This is created by calling DecodeExt::peekable method.
Implementations
impl<D: Decode> Peekable<D>[src]
pub fn peek(&self) -> Option<&D::Item>[src]
Returns a reference to the last item decoded (but not finish_decoding called yet) by the decoder.
pub fn peek_mut(&mut self) -> Option<&mut D::Item>[src]
Returns a mutable reference to the last item decoded (but not finish_decoding called yet) by the decoder.
pub fn inner_ref(&self) -> &D[src]
Returns a reference to the inner decoder.
pub fn inner_mut(&mut self) -> &mut D[src]
Returns a mutable reference to the inner decoder.
pub fn into_inner(self) -> D[src]
Takes ownership of this instance and returns the inner decoder.
Trait Implementations
impl<D: Decode + Debug> Debug for Peekable<D>[src]
impl<D: Decode> Decode for Peekable<D>[src]
type Item = D::Item
The type of items to be decoded.
fn decode(&mut self, buf: &[u8], eos: Eos) -> Result<usize>[src]
fn finish_decoding(&mut self) -> Result<Self::Item>[src]
fn requiring_bytes(&self) -> ByteCount[src]
fn is_idle(&self) -> bool[src]
impl<D: Decode + Default> Default for Peekable<D>[src]
Auto Trait Implementations
impl<D> RefUnwindSafe for Peekable<D> where
D: RefUnwindSafe,
<D as Decode>::Item: RefUnwindSafe,
D: RefUnwindSafe,
<D as Decode>::Item: RefUnwindSafe,
impl<D> Send for Peekable<D> where
D: Send,
<D as Decode>::Item: Send,
D: Send,
<D as Decode>::Item: Send,
impl<D> Sync for Peekable<D> where
D: Sync,
<D as Decode>::Item: Sync,
D: Sync,
<D as Decode>::Item: Sync,
impl<D> Unpin for Peekable<D> where
D: Unpin,
<D as Decode>::Item: Unpin,
D: Unpin,
<D as Decode>::Item: Unpin,
impl<D> UnwindSafe for Peekable<D> where
D: UnwindSafe,
<D as Decode>::Item: UnwindSafe,
D: UnwindSafe,
<D as Decode>::Item: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
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<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> IoDecodeExt for T where
T: Decode, [src]
T: Decode,
fn decode_from_read_buf<B>(&mut self, buf: &mut ReadBuf<B>) -> Result<()> where
B: AsRef<[u8]>, [src]
B: AsRef<[u8]>,
fn decode_exact<R: Read>(&mut self, reader: R) -> Result<Self::Item>[src]
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>,