Files
tantivy/src/common/mod.rs
2016-11-24 09:51:25 +09:00

34 lines
569 B
Rust

mod serialize;
mod timer;
mod vint;
mod bitpacker;
pub use self::serialize::BinarySerializable;
pub use self::timer::Timing;
pub use self::timer::TimerTree;
pub use self::timer::OpenTimer;
pub use self::vint::VInt;
pub use self::bitpacker::compute_num_bits;
use std::io;
pub fn make_io_err(msg: String) -> io::Error {
io::Error::new(io::ErrorKind::Other, msg)
}
/// Has length trait
pub trait HasLen {
/// Return length
fn len(&self,) -> usize;
/// Returns true iff empty.
fn is_empty(&self,) -> bool {
self.len() == 0
}
}