Trait embedded_io::asynch::Seek
source · [−]pub trait Seek: Io {
type SeekFuture<'a>: Future<Output = Result<u64, Self::Error>>
where
Self: 'a;
fn seek<'a>(&'a mut self, pos: SeekFrom) -> Self::SeekFuture<'a>;
fn rewind<'a>(
&'a mut self
) -> impl Future<Output = Result<(), Self::Error>> + 'a { ... }
fn stream_position<'a>(&'a mut self) -> Self::SeekFuture<'a> { ... }
}
Available on crate feature
async
only.Expand description
Async seek within streams.
Semantics are the same as std::io::Seek
, check its documentation for details.
Required Associated Types
Required Methods
sourcefn seek<'a>(&'a mut self, pos: SeekFrom) -> Self::SeekFuture<'a>
fn seek<'a>(&'a mut self, pos: SeekFrom) -> Self::SeekFuture<'a>
Seek to an offset, in bytes, in a stream.
Provided Methods
sourcefn rewind<'a>(
&'a mut self
) -> impl Future<Output = Result<(), Self::Error>> + 'a
fn rewind<'a>(
&'a mut self
) -> impl Future<Output = Result<(), Self::Error>> + 'a
Rewind to the beginning of a stream.
sourcefn stream_position<'a>(&'a mut self) -> Self::SeekFuture<'a>
fn stream_position<'a>(&'a mut self) -> Self::SeekFuture<'a>
Returns the current seek position from the start of the stream.
Implementations on Foreign Types
Implementors
sourceimpl<T: AsyncSeek + Unpin + ?Sized> Seek for FromTokio<T>
Available on crate feature tokio
only.
impl<T: AsyncSeek + Unpin + ?Sized> Seek for FromTokio<T>
Available on crate feature
tokio
only.sourceimpl<T: AsyncSeek + Unpin + ?Sized> Seek for FromFutures<T>
Available on crate feature futures
only.
impl<T: AsyncSeek + Unpin + ?Sized> Seek for FromFutures<T>
Available on crate feature
futures
only.