devela::_dep::symphonia::core::io

Trait SeekBuffered

pub trait SeekBuffered {
    // Required methods
    fn ensure_seekback_buffer(&mut self, len: usize);
    fn unread_buffer_len(&self) -> usize ;
    fn read_buffer_len(&self) -> usize ;
    fn seek_buffered(&mut self, pos: u64) -> u64 ;
    fn seek_buffered_rel(&mut self, delta: isize) -> u64 ;

    // Provided method
    fn seek_buffered_rev(&mut self, delta: usize) { ... }
}
Available on crate feature dep_symphonia only.
Expand description

SeekBuffered provides methods to seek within the buffered portion of a stream.

Required Methods§

fn ensure_seekback_buffer(&mut self, len: usize)

Ensures that len bytes will be available for backwards seeking if len bytes have been previously read.

fn unread_buffer_len(&self) -> usize

Get the number of bytes buffered but not yet read.

Note: This is the maximum number of bytes that can be seeked forwards within the buffer.

fn read_buffer_len(&self) -> usize

Gets the number of bytes buffered and read.

Note: This is the maximum number of bytes that can be seeked backwards within the buffer.

fn seek_buffered(&mut self, pos: u64) -> u64

Seek within the buffered data to an absolute position in the stream. Returns the position seeked to.

fn seek_buffered_rel(&mut self, delta: isize) -> u64

Seek within the buffered data relative to the current position in the stream. Returns the position seeked to.

The range of delta is clamped to the inclusive range defined by -read_buffer_len()..=unread_buffer_len().

Provided Methods§

fn seek_buffered_rev(&mut self, delta: usize)

Seek backwards within the buffered data.

This function is identical to SeekBuffered::seek_buffered_rel when a negative delta is provided.

Implementations on Foreign Types§

§

impl<'b, S> SeekBuffered for &'b mut S
where S: SeekBuffered,

§

fn ensure_seekback_buffer(&mut self, len: usize)

§

fn unread_buffer_len(&self) -> usize

§

fn read_buffer_len(&self) -> usize

§

fn seek_buffered(&mut self, pos: u64) -> u64

§

fn seek_buffered_rel(&mut self, delta: isize) -> u64

Implementors§