u8su 0.2.0

A utility library with u8 slices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::io::{ Write, Result };
use crate::AsBytesExt;

pub trait WriteValue< T > {
    fn write_value(&mut self, value: &T) -> Result< () >;
}

impl< W, T > WriteValue< T > for W
where
    W: Write,
    T: AsBytesExt
{
    fn write_value(&mut self, value: &T) -> Result< () > {
        let slice = value.as_bytes();
        self.write_all(slice)
    }
}