devela/text/bytes.rs
//
//!
//
// IDEA: a safe, mutable static string, where ops are validated.
// with a capacity and length.
/*
help me design a thin layer in Rust to be able to use utf-8 strings as a slice
of [Utf8Bytes], which a static capacity in bytes, but dynamic length of the
string we can. External apis must be safe, and everything can be done safe
*/
#![allow(unused, reason = "WIP")]
///
// THINK DEFAULT?
// use None…something?
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(transparent)]
pub struct Utf8Byte(u8);
///
pub struct Utf8BytesU8<const CAP: usize> {
buf: [u8; CAP], // or Utf8Byte?
len: u8,
}
// NOTES
// - safe methods always validate. use alterantive strategies
// - unsafe for -> &str
// - simd-utf8
// impl<const CAP: usize> Utf8Bytes<CAP> {
// }