1use core::{convert, marker, str};
2use sealed::Sealed;
3
4pub mod raw;
5mod sealed;
6pub mod tokens;
7
8pub struct Target<T>(convert::Infallible, marker::PhantomData<fn(T) -> T>);
10
11pub trait Assign<T>: Sealed<Target<T>> {
13 fn assign(self, value: T);
14}
15
16impl<T> Assign<T> for Target<T> {
17 fn assign(self, _: T) {
18 match self.0 {}
19 }
20}
21
22impl Assign<&str> for Target<String> {
23 fn assign(self, _: &str) {
24 match self.0 {}
25 }
26}
27
28impl<T> Sealed<Target<T>> for Target<T> {}
29impl Sealed<Target<&str>> for Target<String> {}
30
31pub struct Text<const N: usize> {
33 bytes: [u8; N],
34}
35
36impl<const N: usize> Text<N> {
37 const fn new(bytes: [u8; N]) -> Self {
38 Self { bytes }
39 }
40
41 pub const fn as_str(&self) -> &str {
42 unsafe { str::from_utf8_unchecked(&self.bytes) }
45 }
46}