Skip to content

Commit

Permalink
Merge pull request #41 from Nemo157/rearrange
Browse files Browse the repository at this point in the history
Rearrange modules
  • Loading branch information
Nemo157 authored Mar 12, 2017
2 parents cebd07d + c240ca7 commit 4dd3f45
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "roaring"
version = "0.4.2"
version = "0.5.0"
authors = ["Wim Looman <wim@nemo157.com>"]
description = "http://roaringbitmap.org : A better compressed bitset - pure Rust implementation "

Expand Down
2 changes: 1 addition & 1 deletion src/cmp.rs → src/bitmap/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::slice;
use std::iter::Peekable;

use RoaringBitmap;
use container::Container;
use super::container::Container;

struct Pairs<'a>(Peekable<slice::Iter<'a, Container>>, Peekable<slice::Iter<'a, Container>>);

Expand Down
4 changes: 2 additions & 2 deletions src/container.rs → src/bitmap/container.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt;

use util;
use store::{ self, Store };
use super::util;
use super::store::{ self, Store };

const ARRAY_LIMIT: u64 = 4096;

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/inherent.rs → src/bitmap/inherent.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use RoaringBitmap;

use util;
use container::Container;
use super::util;
use super::container::Container;

impl RoaringBitmap {
/// Creates an empty `RoaringBitmap`.
Expand Down
2 changes: 1 addition & 1 deletion src/iter.rs → src/bitmap/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::slice;
use std::vec;

use RoaringBitmap;
use container::Container;
use super::container::Container;

/// An iterator for `RoaringBitmap`.
pub struct Iter<'a> {
Expand Down
36 changes: 36 additions & 0 deletions src/bitmap/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
mod store;
mod container;
mod util;
mod fmt;

// Order of these modules matters as it determines the `impl` blocks order in
// the docs
mod inherent;
mod iter;
mod ops;
mod cmp;
mod serialization;

pub use self::iter::Iter;
pub use self::iter::IntoIter;

/// A compressed bitmap using the [Roaring bitmap compression scheme](http://roaringbitmap.org).
///
/// # Examples
///
/// ```rust
/// use roaring::RoaringBitmap;
///
/// let mut rb = RoaringBitmap::new();
///
/// // insert all primes less than 10
/// rb.insert(2);
/// rb.insert(3);
/// rb.insert(5);
/// rb.insert(7);
/// println!("total bits set to true: {}", rb.len());
/// ```
#[derive(PartialEq, Clone)]
pub struct RoaringBitmap {
containers: Vec<container::Container>,
}
File renamed without changes.
4 changes: 2 additions & 2 deletions src/serialization.rs → src/bitmap/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::io;
use byteorder::{ LittleEndian, ReadBytesExt, WriteBytesExt };

use RoaringBitmap;
use store::Store;
use container::Container;
use super::store::Store;
use super::container::Container;

const SERIAL_COOKIE_NO_RUNCONTAINER: u32 = 12346;
const SERIAL_COOKIE: u16 = 12347;
Expand Down
File renamed without changes.
File renamed without changes.
42 changes: 5 additions & 37 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,11 @@

extern crate byteorder;

mod store;
mod container;
mod util;
mod fmt;

// Order of these modules matters as it determines the `impl` blocks order in
// the docs
mod inherent;
mod iter;
mod ops;
mod cmp;
mod serialization;

pub use iter::Iter;
/// A compressed bitmap using the [Roaring bitmap compression scheme](http://roaringbitmap.org).
pub mod bitmap;

/// A compressed bitmap with u64 values. Implemented as a `BTreeMap` of `RoaringBitmap`s.
pub mod roaring_treemap;

/// A compressed bitmap using the [Roaring bitmap compression scheme](http://roaringbitmap.org).
///
/// # Examples
///
/// ```rust
/// use roaring::RoaringBitmap;
///
/// let mut rb = RoaringBitmap::new();
///
/// // insert all primes less than 10
/// rb.insert(2);
/// rb.insert(3);
/// rb.insert(5);
/// rb.insert(7);
/// println!("total bits set to true: {}", rb.len());
/// ```
#[derive(PartialEq, Clone)]
pub struct RoaringBitmap {
containers: Vec<container::Container>,
}
pub mod treemap;

pub use roaring_treemap::RoaringTreemap;
pub use bitmap::RoaringBitmap;
pub use treemap::RoaringTreemap;
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/roaring_treemap/iter.rs → src/treemap/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::collections::BTreeMap;
use std::collections::btree_map;
use std::iter::{self, FromIterator};

use iter::Iter as Iter32;
use iter::IntoIter as IntoIter32;
use bitmap::Iter as Iter32;
use bitmap::IntoIter as IntoIter32;
use super::util;
use RoaringBitmap;
use RoaringTreemap;
Expand Down
3 changes: 2 additions & 1 deletion src/roaring_treemap/mod.rs → src/treemap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ mod iter;
mod ops;
mod cmp;

pub use iter::{Iter, IntoIter};
pub use self::iter::{Iter, IntoIter};

/// A compressed bitmap with u64 values.
/// Implemented as a `BTreeMap` of `RoaringBitmap`s.
///
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 4dd3f45

Please sign in to comment.