Struct bytecodec::Eos [−][src]
pub struct Eos(_);
Expand description
Eos
contains information on the distance to the end of a stream.
Implementations
Makes a new Eos
instance that
has the given information about the number of remaining bytes in a stream.
Returns true
if the target stream has reached to the end, otherwise false
.
Returns the information about the number of bytes remaining in the target stream.
Returns a new Eos
instance that has moved backward from
the end of the target stream by the specified number of bytes.
Examples
use bytecodec::{ByteCount, Eos}; let eos = Eos::new(true); assert_eq!(eos.is_reached(), true); assert_eq!(eos.remaining_bytes(), ByteCount::Finite(0)); let eos = eos.back(5); assert_eq!(eos.is_reached(), false); assert_eq!(eos.remaining_bytes(), ByteCount::Finite(5));
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Eos
impl UnwindSafe for Eos
Blanket Implementations
Mutably borrows from an owned value. Read more