pub(crate) enum ByteSliceWithIndices<'a> {
Bytes(&'a [(&'a [u8], usize)]),
Str(&'a [(&'a str, usize)]),
}Expand description
An abstraction over a slice of key-value pairs that can have either &[u8]
or &str keys. This is used in the builder to avoid unsound casts.
Variants§
Implementations§
Source§impl<'a> ByteSliceWithIndices<'a>
impl<'a> ByteSliceWithIndices<'a>
pub const fn from_byte_slice(s: &'a [(&'a [u8], usize)]) -> Self
pub const fn from_str_slice(s: &'a [(&'a str, usize)]) -> Self
pub const fn len(&self) -> usize
Sourcepub const fn get_or_panic(&self, index: usize) -> (&'a [u8], usize)
pub const fn get_or_panic(&self, index: usize) -> (&'a [u8], usize)
pub const fn last(&self) -> Option<(&'a [u8], usize)>
pub fn to_vec_u8(self) -> Vec<(&'a [u8], usize)>
pub const fn is_sorted(self) -> bool
pub fn is_all_ascii(&self) -> bool
Trait Implementations§
Source§impl<'a> Clone for ByteSliceWithIndices<'a>
impl<'a> Clone for ByteSliceWithIndices<'a>
Source§fn clone(&self) -> ByteSliceWithIndices<'a>
fn clone(&self) -> ByteSliceWithIndices<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ByteSliceWithIndices<'a>
Auto Trait Implementations§
impl<'a> Freeze for ByteSliceWithIndices<'a>
impl<'a> RefUnwindSafe for ByteSliceWithIndices<'a>
impl<'a> Send for ByteSliceWithIndices<'a>
impl<'a> Sync for ByteSliceWithIndices<'a>
impl<'a> Unpin for ByteSliceWithIndices<'a>
impl<'a> UnsafeUnpin for ByteSliceWithIndices<'a>
impl<'a> UnwindSafe for ByteSliceWithIndices<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more