Trait std::io::Seek
[−]
[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
impl Seek for File
impl<'a> Seek for &'a File
impl<R: Seek> Seek for BufReader<R>
impl<W: Write + Seek> Seek for BufWriter<W>
impl<'a> Seek for Cursor<&'a [u8]>
impl<'a> Seek for Cursor<&'a mut [u8]>
impl Seek for Cursor<Vec<u8>>
impl<'a, S: Seek + ?Sized> Seek for &'a mut S
impl<S: Seek + ?Sized> Seek for Box<S>