Reorganize crate

This commit is contained in:
Carl Lerche
2016-09-23 12:05:32 -07:00
parent d05bfb6346
commit 98e0d954b5
19 changed files with 54 additions and 65 deletions
+4
View File
@@ -1,3 +1,7 @@
//! Buffer allocation
//!
//! This module is currently not really in use
mod heap;
use std::sync::Arc;
+1 -3
View File
@@ -1,6 +1,4 @@
use alloc;
use buf::{MutBuf};
use bytes::Bytes;
use {alloc, MutBuf, Bytes};
use std::cell::Cell;
/// A `Buf` backed by a contiguous region of memory.
+2 -2
View File
@@ -1,7 +1,7 @@
#![allow(warnings)]
use {Buf, MutBuf, AppendBuf, Bytes};
use alloc::{self, /* Pool */};
use {alloc, Buf, MutBuf, Bytes};
use buf::AppendBuf;
use std::{cmp, ptr, slice};
use std::io::Cursor;
use std::rc::Rc;
+2 -1
View File
@@ -4,7 +4,8 @@ pub mod byte;
pub mod ring;
pub mod take;
use {Bytes, Take};
use {Bytes};
use buf::Take;
use byteorder::ByteOrder;
use std::{cmp, fmt, io, ptr, usize};
+1 -1
View File
@@ -1,4 +1,4 @@
use buf::{Buf, MutBuf};
use {Buf, MutBuf};
use std::{cmp};
#[derive(Debug)]
+1 -2
View File
@@ -2,8 +2,7 @@ mod rope;
mod seq;
mod small;
use alloc;
use buf::Buf;
use {alloc, Buf};
use self::seq::Seq;
use self::small::Small;
use self::rope::{Rope, RopeBuf};
+4 -4
View File
@@ -1,7 +1,7 @@
use {Bytes, MutByteBuf};
use buf::{Buf, MutBuf, Source};
use bytes::seq::Seq;
use bytes::small::{Small};
use {Buf, MutBuf, Bytes};
use super::seq::Seq;
use super::small::{Small};
use buf::{Source, MutByteBuf};
use std::{cmp, ops};
use std::io::Cursor;
use std::sync::Arc;
+2 -2
View File
@@ -1,7 +1,7 @@
//! Immutable set of bytes sequential in memory.
use {alloc, MutByteBuf, MutBuf};
use bytes::{Bytes};
use {alloc, MutBuf, Bytes};
use buf::{MutByteBuf};
use std::ops;
use std::io::Cursor;
@@ -1,4 +1,4 @@
use bytes::{Bytes};
use {Bytes};
use std::ops;
use std::io::Cursor;
+4
View File
@@ -0,0 +1,4 @@
//! Used for internal code structure
pub mod buf;
pub mod bytes;
+23 -10
View File
@@ -3,21 +3,34 @@
#[macro_use]
extern crate log;
extern crate byteorder;
mod buf;
mod bytes;
// Implementation in here
mod imp;
pub mod alloc;
pub use buf::{Buf, MutBuf, Source, Sink, Reader, ReadExt, Writer, WriteExt, Fmt};
pub use buf::append::AppendBuf;
pub use buf::block::{BlockBuf, BlockBufCursor};
pub use buf::byte::{ByteBuf, MutByteBuf};
pub use buf::ring::RingBuf;
pub use buf::take::Take;
pub use bytes::Bytes;
pub use imp::buf::{Buf, MutBuf};
pub use imp::bytes::Bytes;
pub mod buf {
pub use imp::buf::{
Source,
Sink,
Reader,
ReadExt,
Writer,
WriteExt,
Fmt,
};
pub use imp::buf::append::AppendBuf;
pub use imp::buf::block::{BlockBuf, BlockBufCursor};
pub use imp::buf::byte::{ByteBuf, MutByteBuf};
pub use imp::buf::ring::RingBuf;
pub use imp::buf::take::Take;
pub use imp::bytes::BytesBuf;
}
use std::u32;