Trait fricgan::IO
[−]
[src]
pub trait IO { fn fio_write(&mut self, sink: &mut [u8]) -> usize; fn fio_read(&mut self, source: &[u8]) -> usize; }
IO is a simple input/output that operates on bytes. It isn't designed to be fancy, it's just designed to be fast. There is likely room for improvement, but for now the implementations work and provide fairly great speed.
The prefix fio
is for fricgan-input-output, and is used to
prevent name collisions.
Required Methods
fn fio_write(&mut self, sink: &mut [u8]) -> usize
Writes bytes to a byte buffer.
self
is mutable because certain types need to step the
internal index/offset value.
This shall write to offset zero (0
).
The return value shall always be the number of bytes written.
fn fio_read(&mut self, source: &[u8]) -> usize
Reads bytes to a byte buffer.
This shall read from offset zero (0
).
The return value shall always be the number of bytes read.