#rc #arc #in-memory #read #u8

rc-u8-reader

A tiny implement for reading u8 data from a reference counted instance

11 stable releases

✓ Uses Rust 2018 edition

2.0.10 Sep 17, 2019
2.0.9 Jul 28, 2019
2.0.3 Jun 24, 2019
2.0.1 May 26, 2019
1.0.1 May 26, 2019

#80 in Data structures

Download history 75/week @ 2019-07-06 4/week @ 2019-07-13 104/week @ 2019-07-20 89/week @ 2019-07-27 112/week @ 2019-08-03 61/week @ 2019-08-10 31/week @ 2019-08-17 225/week @ 2019-08-24 33/week @ 2019-08-31 91/week @ 2019-09-07 169/week @ 2019-09-14 100/week @ 2019-09-21 43/week @ 2019-09-28 27/week @ 2019-10-05 5/week @ 2019-10-12

342 downloads per month
Used in 6 crates (3 directly)

MIT license

21KB
504 lines

Rc U8 Reader

Build Status

A tiny implement for reading u8 data from a reference counted instance.

Examples

RcU8Reader

extern crate rc_u8_reader;

use std::rc::Rc;
use std::io::Read;

use rc_u8_reader::RcU8Reader;

let data = b"Hello world!".to_vec();

let mut reader = RcU8Reader::new(Rc::new(data));

let mut result = String::new();

reader.read_to_string(&mut result).unwrap();

assert_eq!("Hello world!".to_string(), result);

RcRefCellU8Reader

extern crate rc_u8_reader;

use std::cell::RefCell;
use std::rc::Rc;
use std::io::Read;

use rc_u8_reader::RcRefCellU8Reader;

let data = b"Hello world!".to_vec();

let mut reader = RcRefCellU8Reader::new(Rc::new(RefCell::new(data)));

let mut result = String::new();

reader.read_to_string(&mut result).unwrap();

assert_eq!("Hello world!".to_string(), result);

ArcU8Reader

extern crate rc_u8_reader;

use std::sync::Arc;
use std::io::Read;

use rc_u8_reader::ArcU8Reader;

let data = b"Hello world!".to_vec();

let mut reader = ArcU8Reader::new(Arc::new(data));

let mut result = String::new();

reader.read_to_string(&mut result).unwrap();

assert_eq!("Hello world!".to_string(), result);

ArcMutexU8Reader

extern crate rc_u8_reader;

use std::sync::{Arc, Mutex};
use std::io::Read;

use rc_u8_reader::ArcMutexU8Reader;

let data = b"Hello world!".to_vec();

let mut reader = ArcMutexU8Reader::new(Arc::new(Mutex::new(data)));

let mut result = String::new();

reader.read_to_string(&mut result).unwrap();

assert_eq!("Hello world!".to_string(), result);

Crates.io

https://crates.io/crates/rc-u8-reader

Documentation

https://docs.rs/rc-u8-reader

License

MIT

Dependencies

~20KB