Trait embedded_io_async::Seek

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

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

Async seek within streams.

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

Required Methods§

source

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

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

Provided Methods§

source

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

Rewind to the beginning of a stream.

source

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

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

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

source§

impl<T: ?Sized + Seek> Seek for Box<T>

source§

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

Implementors§