[][src]Trait futures::io::AsyncSeek

pub trait AsyncSeek {
    fn poll_seek(
        self: Pin<&mut Self>,
        cx: &mut Context,
        pos: SeekFrom
    ) -> Poll<Result<u64, Error>>; }

Seek bytes asynchronously.

This trait is analogous to the std::io::Seek trait, but integrates with the asynchronous task system. In particular, the poll_seek method, unlike Seek::seek, will automatically queue the current task for wakeup and return if data is not yet available, rather than blocking the calling thread.

Required methods

fn poll_seek(
    self: Pin<&mut Self>,
    cx: &mut Context,
    pos: SeekFrom
) -> Poll<Result<u64, Error>>

Attempt to seek to an offset, in bytes, in a stream.

A seek beyond the end of a stream is allowed, but behavior is defined by the implementation.

If the seek operation completed successfully, this method returns the new position from the start of the stream. That position can be used later with SeekFrom::Start.

Errors

Seeking to a negative offset is considered an error.

Loading content...

Implementations on Foreign Types

impl<P> AsyncSeek for Pin<P> where
    P: DerefMut + Unpin,
    <P as Deref>::Target: AsyncSeek
[src]

impl<T> AsyncSeek for Cursor<T> where
    T: Unpin + AsRef<[u8]>, 
[src]

impl<T> AsyncSeek for Box<T> where
    T: AsyncSeek + Unpin + ?Sized
[src]

impl<'_, T> AsyncSeek for &'_ mut T where
    T: AsyncSeek + Unpin + ?Sized
[src]

Loading content...

Implementors

impl<T> AsyncSeek for AllowStdIo<T> where
    T: Seek
[src]

Loading content...