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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use crate::{
Bin, BooToOwned, DefaultStrBuilder, NewBin, NewSBin, SBin, SStr, Str, StrBuilder, StrFactory,
};
use std::marker::PhantomData;
pub struct NewStr {
_phantom: PhantomData<()>,
}
impl NewStr {
#[inline]
pub fn builder<'a>() -> impl StrBuilder<'a, T = Bin> {
DefaultStrBuilder::new(NewBin::builder())
}
}
impl StrFactory for NewStr {
type TBinFactory = NewBin;
}
impl BooToOwned<str, Str> for NewStr {
fn convert_to_owned(borrowed: &str) -> Str {
Self::copy_from_str(borrowed)
}
}
pub struct NewSStr {
_phantom: PhantomData<()>,
}
impl NewSStr {
#[inline]
pub fn builder<'a>() -> impl StrBuilder<'a, T = SBin> {
DefaultStrBuilder::new(NewSBin::builder())
}
}
impl StrFactory for NewSStr {
type TBinFactory = NewSBin;
}
impl BooToOwned<str, SStr> for NewSStr {
fn convert_to_owned(borrowed: &str) -> SStr {
Self::copy_from_str(borrowed)
}
}