Trait pw_stream::Seek

source ·
pub trait Seek {
    // Required method
    fn seek(&mut self, pos: SeekFrom) -> Result<u64>;

    // Provided methods
    fn rewind(&mut self) -> Result<()> { ... }
    fn stream_len(&mut self) -> Result<u64> { ... }
    fn stream_position(&mut self) -> Result<u64> { ... }
}
Expand description

A trait for objects that provide the ability to seek withing a stream.

Required Methods§

source

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

Adjust the current position of the stream.

Semantics match std::io::Seek::seek().

Provided Methods§

source

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

Set the current position of the stream to its beginning.

Semantics match std::io::Seek::rewind().

source

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

Returns the length of the stream.

Semantics match std::io::Seek::stream_len().

source

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

Returns the current position of the stream.

Semantics match std::io::Seek::stream_position().

Implementors§

source§

impl<T: AsRef<[u8]>> Seek for Cursor<T>