strs_tools/
lib.rs

1#![ cfg_attr( all( feature = "no_std", not( feature = "std" ) ), no_std ) ]
2#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ]
3#![ doc
4(
5  html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico"
6) ]
7#![ doc( html_root_url = "https://docs.rs/strs_tools/latest/strs_tools/" ) ]
8#![ cfg_attr( doc, doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "readme.md" ) ) ) ]
9#![ cfg_attr( not( doc ), doc = "String manipulation utilities" ) ]
10#![ allow( clippy::std_instead_of_alloc ) ]
11#![ allow( clippy::must_use_candidate ) ]
12#![ allow( clippy::elidable_lifetime_names ) ]
13#![ allow( clippy::std_instead_of_core ) ]
14#![ allow( clippy::manual_strip ) ]
15#![ allow( clippy::doc_markdown ) ]
16#![ allow( clippy::new_without_default ) ]
17#![ allow( clippy::clone_on_copy ) ]
18#![ allow( clippy::single_match_else ) ]
19#![ allow( clippy::return_self_not_must_use ) ]
20#![ allow( clippy::match_same_arms ) ]
21#![ allow( clippy::missing_panics_doc ) ]
22#![ allow( clippy::missing_errors_doc ) ]
23#![ allow( clippy::iter_cloned_collect ) ]
24#![ allow( clippy::redundant_closure ) ]
25#![ allow( clippy::uninlined_format_args ) ]
26
27//! # Rule Compliance & Architectural Notes
28//!
29//! This crate has been systematically updated to comply with the Design and Codestyle Rulebooks.
30//! Key compliance achievements and ongoing considerations :
31//!
32//! ## Completed Compliance Work :
33//!
34//! 1. **Documentation Strategy** : Uses `#![ doc = include_str!(...) ]` to include readme.md
35//!    instead of duplicating documentation. This is the mandated approach for all entry files.
36//!
37//! 2. **Workspace Dependencies** : All external dependencies now inherit from workspace with
38//!    `{ workspace = true }`. SIMD optimization deps (memchr, aho-corasick, bytecount, lexical)
39//!    were moved to workspace level for version consistency.
40//!
41//! 3. **Attribute Formatting** : All attributes use proper spacing per Universal Formatting Rule :
42//!    `#[ cfg( feature = "enabled" ) ]` instead of `#[ cfg( feature = "enabled" ) ]`
43//!
44//! 4. **Manual Namespace Architecture** : Uses the standard wTools manual namespace pattern
45//!    (private/own/orphan/exposed/prelude) for precise API control and stable public interfaces.
46//!
47//! ## Critical Architectural Decisions :
48//!
49//! - **Feature Gating** : All functionality is gated behind the "enabled" feature for
50//!   granular control over compilation and dependencies.
51//!
52//! - **Error Handling** : Uses `error_tools` exclusively - no `anyhow` or `thiserror` dependencies
53//!   per Design Rulebook requirements.
54//!
55//! - **Testing Isolation** : All tests are in `tests/` directory, never in `src/`, following
56//!   the mandatory testing architecture pattern.
57
58/// String tools.
59#[ cfg( feature = "enabled" ) ]
60pub mod string;
61
62/// SIMD-optimized string operations.
63#[ cfg( all( feature = "enabled", feature = "simd" ) ) ]
64pub mod simd;
65
66/// ANSI escape sequence handling utilities.
67#[ cfg( all( feature = "enabled", feature = "ansi" ) ) ]
68pub mod ansi;
69
70/// Re-export compile-time optimization macros.
71#[ cfg( all( feature = "enabled", feature = "compile_time_optimizations" ) ) ]
72#[ allow( unused_imports ) ]
73pub use strs_tools_meta::*;
74
75#[ doc( inline ) ]
76#[ allow( unused_imports ) ]
77#[ cfg( feature = "enabled" ) ]
78pub use own::*;
79
80/// Own namespace of the module.
81#[ cfg( feature = "enabled" ) ]
82#[ allow( unused_imports ) ]
83pub mod own
84{
85  #[ allow( unused_imports ) ]
86  use super::*;
87  pub use orphan::*;
88  pub use super::string;
89  #[ cfg( feature = "simd" ) ]
90  pub use super::simd;
91  #[ cfg( feature = "ansi" ) ]
92  pub use super::ansi;
93  #[ cfg( test ) ]
94  pub use super::string::orphan::*;
95}
96
97/// Parented namespace of the module.
98#[ cfg( feature = "enabled" ) ]
99#[ allow( unused_imports ) ]
100pub mod orphan
101{
102  #[ allow( unused_imports ) ]
103  use super::*;
104  pub use exposed::*;
105}
106
107/// Exposed namespace of the module.
108#[ cfg( feature = "enabled" ) ]
109#[ allow( unused_imports ) ]
110pub mod exposed
111{
112  #[ allow( unused_imports ) ]
113  use super::*;
114  pub use prelude::*;
115  pub use super::string::exposed::*;
116}
117
118/// Namespace of the module to include with `use module::*`.
119#[ cfg( feature = "enabled" ) ]
120#[ allow( unused_imports ) ]
121pub mod prelude
122{
123  #[ allow( unused_imports ) ]
124  use super::*;
125  pub use super::string::prelude::*;
126}