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

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.

Reads bytes to a byte buffer.

This shall read from offset zero (0).

The return value shall always be the number of bytes read.

Implementations on Foreign Types

impl IO for [u8]
[src]

[src]

[src]

impl IO for u8
[src]

[src]

[src]

impl IO for i8
[src]

[src]

[src]

impl IO for u16
[src]

[src]

[src]

impl IO for i16
[src]

[src]

[src]

impl IO for u32
[src]

[src]

[src]

impl IO for i32
[src]

[src]

[src]

impl IO for f32
[src]

[src]

[src]

impl IO for u64
[src]

[src]

[src]

impl IO for i64
[src]

[src]

[src]

impl IO for f64
[src]

[src]

[src]

Implementors