pub type NonEmptyBytes = NonEmptySlice<u8>;Expand description
Represents non-empty bytes, NonEmptySlice<u8>.
Aliased Type§
pub struct NonEmptyBytes { /* private fields */ }Implementations§
Source§impl NonEmptyBytes
impl NonEmptyBytes
Sourcepub const fn is_ascii(&self) -> bool
pub const fn is_ascii(&self) -> bool
Checks if all bytes in the slice are within the ASCII range.
Sourcepub const fn eq_ignore_ascii_case(&self, other: &Self) -> bool
pub const fn eq_ignore_ascii_case(&self, other: &Self) -> bool
Checks that the two slices are ASCII case-insensitively equal.
Sourcepub const fn make_ascii_uppercase(&mut self)
pub const fn make_ascii_uppercase(&mut self)
Converts the slice to its ASCII uppercase equivalent in-place.
Sourcepub const fn make_ascii_lowercase(&mut self)
pub const fn make_ascii_lowercase(&mut self)
Converts the slice to its ASCII lowercase equivalent in-place.
Sourcepub const fn trim_ascii_start(&self) -> &[u8] ⓘ
pub const fn trim_ascii_start(&self) -> &[u8] ⓘ
Returns new slice with leading ASCII whitespace bytes removed.
Sourcepub const fn trim_ascii_end(&self) -> &[u8] ⓘ
pub const fn trim_ascii_end(&self) -> &[u8] ⓘ
Returns new slice with trailing ASCII whitespace bytes removed.
Sourcepub const fn trim_ascii(&self) -> &[u8] ⓘ
pub const fn trim_ascii(&self) -> &[u8] ⓘ
Returns new slice with leading and trailing ASCII whitespace bytes removed.
Sourcepub const fn escape_ascii(&self) -> EscapeAscii<'_>
pub const fn escape_ascii(&self) -> EscapeAscii<'_>
Returns non-empty iterators that produce escaped version of the slice, treating it as ASCII string.
Trait Implementations§
Source§impl Write for &mut NonEmptyBytes
Available on crate feature std only.
impl Write for &mut NonEmptyBytes
Available on crate feature
std only.Source§fn write(&mut self, buffer: &[u8]) -> Result<usize>
fn write(&mut self, buffer: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn write_all(&mut self, buffer: &[u8]) -> Result<()>
fn write_all(&mut self, buffer: &[u8]) -> Result<()>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_fmt(&mut self, arguments: Arguments<'_>) -> Result<()>
fn write_fmt(&mut self, arguments: Arguments<'_>) -> Result<()>
Writes a formatted string into this writer, returning any error
encountered. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)