optempty 0.1.13

Tools for working types that may be empty. E.g., an empty `String`, `Vec`, `HashMap`, etc.
Documentation
mod no_std;
#[cfg(all(feature = "querymap", feature = "std"))]
mod query_map;
#[cfg(feature = "serdejson")]
mod serde_json;
#[cfg(feature = "std")]
mod std;

pub use self::no_std::*;
#[cfg(all(feature = "querymap", feature = "std"))]
pub use self::query_map::*;
#[cfg(feature = "serdejson")]
pub use self::serde_json::*;
#[cfg(feature = "std")]
pub use self::std::*;

/// Used to determine if a collection, or `Option<T>` or `Result<T, E>` (where
/// `T` implements `IsEmpty`) is empty.
///
/// `IsEmpty` is implemented for the standard collections, and more.
pub trait IsEmpty {
    /// Returns `true` if it is empty.
    fn is_empty(&self) -> bool;
}