#[repr(transparent)]pub(crate) struct ByteStr([u8]);
Expand description
A struct transparent over [u8]
with convenient helper functions.
Tuple Fields§
§0: [u8]
Implementations§
source§impl ByteStr
impl ByteStr
pub const fn from_byte_slice_with_value<'a, 'l>( input: &'l [(&'a [u8], usize)], ) -> &'l [(&'a ByteStr, usize)]
pub const fn from_str_slice_with_value<'a, 'l>( input: &'l [(&'a str, usize)], ) -> &'l [(&'a ByteStr, usize)]
pub fn from_bytes(input: &[u8]) -> &Self
pub fn from_str(input: &str) -> &Self
pub fn empty() -> &'static Self
pub const fn as_bytes(&self) -> &[u8] ⓘ
pub const fn len(&self) -> usize
pub fn is_all_ascii(&self) -> bool
pub(crate) fn byte_at(&self, index: usize) -> Option<u8>
sourcepub(crate) const fn byte_at_or_panic(&self, index: usize) -> u8
pub(crate) const fn byte_at_or_panic(&self, index: usize) -> u8
Returns the byte at the given index, panicking if out of bounds.
sourcepub(crate) const fn is_less_then(&self, other: &Self) -> bool
pub(crate) const fn is_less_then(&self, other: &Self) -> bool
Const function to evaluate self < other
.
Trait Implementations§
source§impl PartialEq for ByteStr
impl PartialEq for ByteStr
source§impl PartialOrd for ByteStr
impl PartialOrd for ByteStr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more