1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! `stdx` module provides utilities and extensions for working with Rust's standard library.
//!
//! # Submodules
//!
//! - `error`: It defines custom errors present in the `stdx` module.
//! - `primitive_number`: It is dedicated to working with numbers, providing useful types or
//! complementary methods.
//! - `collections`: It is dedicated to collections, providing utilities for iteration,
//! transformation or validation.
//! - `string`: It is dedicated to strings, providing useful types or complementary methods.
//! - `extension`: Contains utilities for working with scope functions like closures and
//! higher-order functions and additional utilities for some <type|struct> manipulation.
//!
//! # Usage
//!
//! Import the specific functionality required into your project, e.g.:
//!
//! ```rust
//! use catalyser::stdx::{
//! extension::{
//! str_extension::MultilineStr,
//! scope_functions_extension::TakeIf
//! },
//! collections::NonEmptyVec,
//! primitive_number::BoundedI32,
//! string::NonEmptyString
//! };
//!
//! let non_empty_string = NonEmptyString::new("hello world".to_string());
//! let bounded_i32 = BoundedI32::<-10,10>::new(0)
//! .take_if(|it| it.is_ok());
//! let non_empty_vec = NonEmptyVec::new(vec![0, 1, 2, 3]);
//! let multiline_string = "\
//! |Indented line 1
//! |Indented line 2
//! ".trim_margin();
//!
//! ```