[][src]Trait bi::Bi

pub trait Bi {
    type Resource;
    fn max_buf_size(&self) -> u64;
fn buf_size(&self) -> u64;
fn read(&self, res: Self::Resource) -> Result<(usize, Vec<u8>)>;
fn read_to_string(&self, res: Self::Resource) -> Result<(usize, String)>;
fn release_read(&self, id: usize) -> Result<()>;
fn write<B: AsRef<[u8]>>(&self, bytes: B, res: Self::Resource) -> Result<()>; }

Bi

Simple trait for reading/writing resources.


Implementations are not required to make read IDs unique. It's simply because usize has limit. However, for example, on 32-bit system, you still have billions of IDs to use.

Associated Types

Loading content...

Required methods

Loading content...

Implementors

impl<'a> Bi for FileBi<'a>[src]

type Resource = &'a Path

Loading content...