Struct nue_io::Region [] [src]

pub struct Region<T> {
    // some fields omitted
}

Creates an isolated segment of an underlying stream.

Seeks past the region will be capped, and reaching the end of the region will result in EOF when reading or writing.

Methods

impl<T> Region<T>

fn new(inner: T, start: u64, end: u64) -> Self

Creates a new Region at the specified offsets of inner.

fn region(&self) -> (u64, u64)

Returns the region bounds.

fn into_inner(self) -> T

Unwraps the Region to return the inner stream.

Trait Implementations

impl<T: Read + Tell + SeekAbsolute> Read for Region<T>

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl<T: Write + Tell + SeekAbsolute> Write for Region<T>

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write

impl<T: SeekAbsolute> SeekAbsolute for Region<T>

fn seek_absolute(&mut self, pos: u64) -> Result<u64>

impl<T: SeekForward + Tell + SeekAbsolute> SeekForward for Region<T>

fn seek_forward(&mut self, offset: u64) -> Result<u64>

impl<T: Tell + SeekBackward> SeekBackward for Region<T>

fn seek_backward(&mut self, offset: u64) -> Result<u64>

impl<T: SeekAbsolute> SeekRewind for Region<T>

fn seek_rewind(&mut self) -> Result<()>

impl<T: SeekAbsolute> SeekEnd for Region<T>

fn seek_end(&mut self, offset: i64) -> Result<u64>

impl<T: Tell> Tell for Region<T>

fn tell(&mut self) -> Result<u64>

impl<T: BufRead + Tell + SeekAbsolute> BufRead for Region<T>

fn fill_buf(&mut self) -> Result<&[u8]>

fn consume(&mut self, amt: usize)

fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>

fn split(self, byte: u8) -> Split<Self>

fn lines(self) -> Lines<Self>