pahi-olin 0.1.0

The pa'i runtime API bindings
Documentation
use crate::resource::Resource;
use std::io::{self, Read, Write};
use url::Url;

pub struct Null {}

impl Resource for Null {
    fn new(_: Url) -> Null {
        Null {}
    }

    fn close(&mut self) {}
}

impl Read for Null {
    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
        Ok(buf.len())
    }
}

impl Write for Null {
    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
        Ok(buf.len())
    }

    fn flush(&mut self) -> io::Result<()> {
        Ok(())
    }
}