smallstr/
lib.rs

1//! Implements `SmallString`, a `String`-like container for small strings
2//!
3//! ## `no_std` support
4//!
5//! By default, `smallstr` does not depend on `std`. The `std` feature may be enabled
6//! to add the `std` dependency. The `ffi` feature also implies `std`.
7//!
8//! ## `ffi` feature
9//!
10//! The `ffi` feature will add the following trait implementations to `SmallString`:
11//!
12//! * `PartialEq<OsStr>`
13//! * `PartialEq<&'_ OsStr>`
14//! * `PartialEq<OsString>`
15//! * `PartialEq<Cow<'_, OsString>>`
16//!
17//! This feature also adds `std` as a dependency.
18//!
19//! ## `serde` support
20//!
21//! When the `serde` feature is enabled, the traits `serde::Deserialize` and
22//! `serde::Serialize` are implemented for `SmallString`.
23//!
24//! This feature is disabled by default.
25//!
26//! By default, the `serde` dependency is compiled with `no_std`.
27//! If the `std` feature is enabled, `std` is added as a dependency in `serde`, as well.
28//!
29//! ## `union` feature
30//!
31//! This feature will enable the `union` feature in `smallvec`, which reduces the size of
32//! a `SmallString` instance. This feature requires Rust 1.49 or newer.
33
34#![cfg_attr(not(any(feature = "ffi", feature = "std")), no_std)]
35#![deny(missing_docs)]
36
37extern crate alloc;
38
39pub use string::*;
40
41mod string;