embedded_io

Trait Seek

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

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

Blocking seek within streams.

This trait is the embedded-io equivalent of [std::io::Seek].

Required Methods§

Source

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

Seek to an offset, in bytes, in a stream.

Provided Methods§

Source

fn rewind(&mut self) -> Result<(), Self::Error>

Rewind to the beginning of a stream.

Source

fn stream_position(&mut self) -> Result<u64, Self::Error>

Returns the current seek position from the start of the stream.

Implementations on Foreign Types§

Source§

impl<T: ?Sized + Seek> Seek for &mut T

Source§

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

Implementors§