Trait SeekOctetStream

Source
pub trait SeekOctetStream {
    // Required methods
    fn seek(&mut self, pos: u64) -> Result<()>;
    fn stream_position(&mut self) -> Result<u64>;
}
Expand description

Custom trait for seeking within an octet stream.

Required Methods§

Source

fn seek(&mut self, pos: u64) -> Result<()>

Moves the cursor to the specified octet position from the start of the stream.

§Arguments
  • pos - The octet position to seek to.
§Returns
  • Ok(()) if the operation is successful.
  • Err(io::Error) if an I/O error occurs.
Source

fn stream_position(&mut self) -> Result<u64>

Retrieves the current octet position of the cursor in the stream.

§Returns
  • Ok(u64) representing the current octet position.
  • Err(io::Error) if an I/O error occurs.

Implementors§

Source§

impl<S: Seek> SeekOctetStream for S

Blanket implementation of SeekOctetStream for all types that implement Seek.