Trait std::io::SeekUnstable [-] [+] [src]

pub trait Seek {
    fn seek(&mut self, pos: SeekFrom) -> Result<u64>;
}

An object implementing Seek internally has some form of cursor which can be moved within a stream of bytes.

The stream typically has a fixed size, allowing seeking relative to either end or the current offset.

Required Methods

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

Seek to an offset, in bytes, in a stream

A seek beyond the end of a stream is allowed, but seeking before offset 0 is an error.

The behavior when seeking past the end of the stream is implementation defined.

This method returns the new position within the stream if the seek operation completed successfully.

Errors

Seeking to a negative offset is considered an error

Implementors