Skip to main content

ByteSource

Trait ByteSource 

Source
pub trait ByteSource {
    // Required methods
    fn len(&self) -> u64;
    fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn len(&self) -> u64

Source

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Provided Methods§

Source

fn is_empty(&self) -> bool

Implementations on Foreign Types§

Source§

impl ByteSource for Vec<u8>

Source§

fn len(&self) -> u64

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Source§

impl ByteSource for File

Available on non-WebAssembly only.
Source§

fn len(&self) -> u64

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Source§

impl ByteSource for [u8]

Source§

fn len(&self) -> u64

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Source§

impl<T: ByteSource + ?Sized> ByteSource for &T

Source§

fn len(&self) -> u64

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Source§

impl<T: ByteSource + ?Sized> ByteSource for Box<T>

Source§

fn len(&self) -> u64

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Source§

impl<T: ByteSource + ?Sized> ByteSource for Arc<T>

Source§

fn len(&self) -> u64

Source§

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Implementors§