arr_rs/alphanumeric/types/
mod.rs1pub mod char;
3
4pub mod string;
6
7use crate::core::types::{
8 ArrayElement,
9 collection::List,
10 tuple::tuple3::Tuple3,
11};
12
13pub trait Alphanumeric: ArrayElement {
15
16 fn from_str(str: &str) -> Self;
18
19 #[must_use]
21 fn _append(&self, other: Self) -> Self;
22
23 #[must_use]
25 fn _multiply(&self, n: usize) -> Self;
26
27 #[must_use]
29 fn _capitalize(&self) -> Self;
30
31 #[must_use]
33 fn _lower(&self) -> Self;
34
35 #[must_use]
37 fn _upper(&self) -> Self;
38
39 #[must_use]
41 fn _swapcase(&self) -> Self;
42
43 #[must_use]
45 fn _center(&self, width: usize, fill_char: char) -> Self;
46
47 #[must_use]
49 fn _join(&self, sep: Self) -> Self;
50
51 fn _partition(&self, sep: Self) -> Tuple3<Self, Self, Self>;
53
54 fn _rpartition(&self, sep: Self) -> Tuple3<Self, Self, Self>;
56
57 fn _split(&self, sep: Self, max_split: Option<usize>) -> List<Self>;
59
60 fn _rsplit(&self, sep: Self, max_split: Option<usize>) -> List<Self>;
62
63 fn _splitlines(&self, keep_ends: bool) -> List<Self>;
65
66 #[must_use]
68 fn _replace(&self, old: Self, new: Self, count: Option<usize>) -> Self;
69
70 #[must_use]
72 fn _strip(&self, chars: Self) -> Self;
73
74 #[must_use]
76 fn _ljust(&self, width: usize, fill_char: char) -> Self;
77
78 #[must_use]
80 fn _lstrip(&self, chars: Self) -> Self;
81
82 #[must_use]
84 fn _rjust(&self, width: usize, fill_char: char) -> Self;
85
86 #[must_use]
88 fn _rstrip(&self, chars: Self) -> Self;
89
90 fn _equal(&self, other: Self) -> bool;
92
93 fn _not_equal(&self, other: Self) -> bool;
95
96 fn _greater_equal(&self, other: Self) -> bool;
98
99 fn _less_equal(&self, other: Self) -> bool;
101
102 fn _greater(&self, other: Self) -> bool;
104
105 fn _less(&self, other: Self) -> bool;
107
108 fn _count(&self, sub: &str) -> usize;
110}