flexstr/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![cfg_attr(
3    all(
4        not(all(feature = "win_min_unsafe", target_family = "windows")),
5        feature = "safe"
6    ),
7    forbid(unsafe_code)
8)]
9#![cfg_attr(docsrs, feature(doc_cfg))]
10#![warn(missing_docs)]
11
12//! A flexible, simple to use, immutable, clone-efficient [String] replacement for Rust
13
14extern crate alloc;
15
16#[doc = include_str!("../README.md")]
17mod readme_tests {}
18
19#[cfg(feature = "bytes")]
20/// Module for byte-based strings (`[u8]`)
21pub mod bytes;
22#[cfg(feature = "cstr")]
23/// Module for `CStr`-based strings
24pub mod cstr;
25mod flex;
26#[cfg(all(feature = "std", feature = "osstr"))]
27/// Module for `OsStr`-based strings
28pub mod osstr;
29#[cfg(all(feature = "std", feature = "path"))]
30/// Module for `Path`-based strings
31pub mod path;
32#[cfg(feature = "str")]
33/// Module for `str`-based strings
34pub mod str;
35
36#[cfg(feature = "bytes")]
37pub use bytes::{LocalBytes, SharedBytes};
38#[cfg(feature = "cstr")]
39pub use cstr::{LocalCStr, SharedCStr};
40pub use flex::{FlexStr, ImmutableBytes, RefCounted, RefCountedMut};
41#[cfg(feature = "cstr")]
42pub use flexstr_support::InteriorNulError;
43pub use flexstr_support::StringLike;
44#[cfg(all(feature = "std", feature = "osstr"))]
45pub use osstr::{LocalOsStr, SharedOsStr};
46#[cfg(all(feature = "std", feature = "path"))]
47pub use path::{LocalPath, SharedPath};
48#[cfg(feature = "str")]
49pub use str::{LocalStr, SharedStr};