Trait mp4san::AsyncSkip

source ·
pub trait AsyncSkip {
    // Required methods
    fn poll_skip(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        amount: u64
    ) -> Poll<Result<(), Error>>;
    fn poll_stream_position(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Result<u64, Error>>;
    fn poll_stream_len(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Result<u64, Error>>;
}
Expand description

A subset of the [AsyncSeek] trait, providing a cursor which can skip forward within a stream of bytes.

Required Methods§

source

fn poll_skip( self: Pin<&mut Self>, cx: &mut Context<'_>, amount: u64 ) -> Poll<Result<(), Error>>

Skip an amount of bytes in a stream.

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

source

fn poll_stream_position( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

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

source

fn poll_stream_len( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

Returns the length of this stream, in bytes.

Implementations on Foreign Types§

source§

impl<P> AsyncSkip for Pin<P>
where P: DerefMut + Unpin, <P as Deref>::Target: AsyncSkip,

source§

fn poll_skip( self: Pin<&mut Pin<P>>, cx: &mut Context<'_>, amount: u64 ) -> Poll<Result<(), Error>>

source§

fn poll_stream_position( self: Pin<&mut Pin<P>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

fn poll_stream_len( self: Pin<&mut Pin<P>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

impl<R> AsyncSkip for &mut R
where R: AsyncSkip + Unpin + ?Sized,

source§

fn poll_skip( self: Pin<&mut &mut R>, cx: &mut Context<'_>, amount: u64 ) -> Poll<Result<(), Error>>

source§

fn poll_stream_position( self: Pin<&mut &mut R>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

fn poll_stream_len( self: Pin<&mut &mut R>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

impl<R> AsyncSkip for Box<R>
where R: AsyncSkip + Unpin + ?Sized,

source§

fn poll_skip( self: Pin<&mut Box<R>>, cx: &mut Context<'_>, amount: u64 ) -> Poll<Result<(), Error>>

source§

fn poll_stream_position( self: Pin<&mut Box<R>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

fn poll_stream_len( self: Pin<&mut Box<R>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

impl<R> AsyncSkip for BufReader<R>
where R: AsyncRead + AsyncSkip,

source§

fn poll_skip( self: Pin<&mut BufReader<R>>, cx: &mut Context<'_>, amount: u64 ) -> Poll<Result<(), Error>>

Poll skipping amount bytes in a BufReader implementing [AsyncRead] + AsyncSkip.

source§

fn poll_stream_position( self: Pin<&mut BufReader<R>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

Poll the stream position for a BufReader implementing [AsyncRead] + AsyncSkip.

source§

fn poll_stream_len( self: Pin<&mut BufReader<R>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

Poll the stream length for a BufReader implementing [AsyncRead] + AsyncSkip.

source§

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

source§

fn poll_skip( self: Pin<&mut Cursor<T>>, cx: &mut Context<'_>, amount: u64 ) -> Poll<Result<(), Error>>

source§

fn poll_stream_position( self: Pin<&mut Cursor<T>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

source§

fn poll_stream_len( self: Pin<&mut Cursor<T>>, cx: &mut Context<'_> ) -> Poll<Result<u64, Error>>

Implementors§

source§

impl<R> AsyncSkip for SeekSkipAdapter<R>
where R: AsyncSeek + Unpin + ?Sized,

source§

impl<T> AsyncSkip for AsyncInputAdapter<T>
where T: Skip + Unpin,