Struct bytecodec::Eos[][src]

pub struct Eos(_);

Eos contains information on the distance to the end of a stream.

Methods

impl Eos
[src]

Makes a new Eos instance.

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

impl Debug for Eos
[src]

Formats the value using the given formatter. Read more

impl Clone for Eos
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Eos
[src]

impl PartialEq for Eos
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Eos
[src]

impl Hash for Eos
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialOrd for Eos
[src]

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

impl Send for Eos

impl Sync for Eos