tranche/lib.rs
1// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
2// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4// option. This file may not be copied, modified, or distributed
5// except according to those terms.
6
7//! # Tranche
8//!
9//! See [`Tranche<'_, T>`](struct.Tranche.html) for what this crate does.
10//!
11//! This crate is `no_std` by default, the `std` feature provides:
12//!
13//! * an implementation of `std::error::Error` for
14//! [`UnexpectedEndError`](struct.UnexpectedEndError.html);
15//! * an implementation of `std::io::Read` and `std::io::BufRead` for
16//! [`BufTranche<'_>`](type.BufTranche.html) and
17//! [`BasedBufTranche<'_>`](type.BasedBufTranche.html);
18//! * an implementation of `From<UnexpectedEndError>` for `std::io::Error`.
19
20#![cfg_attr(not(feature = "std"), no_std)]
21#![deny(unsafe_code)]
22
23#[allow(unsafe_code)]
24mod core;
25
26#[allow(unsafe_code)]
27mod buf;
28
29#[forbid(unsafe_code)]
30mod iter;
31
32#[cfg(feature = "std")]
33#[forbid(unsafe_code)]
34mod std;
35
36pub use self::core::{BasedBufTranche, BasedTranche, BufTranche, Tranche, UnexpectedEndError};