NonEmptyBytes

Type Alias NonEmptyBytes 

Source
pub type NonEmptyBytes = NonEmptySlice<u8>;
Expand description

Represents non-empty bytes, NonEmptySlice<u8>.

Aliased Type§

pub struct NonEmptyBytes { /* private fields */ }

Implementations§

Source§

impl NonEmptyBytes

Source

pub const fn is_ascii(&self) -> bool

Checks if all bytes in the slice are within the ASCII range.

Source

pub const fn eq_ignore_ascii_case(&self, other: &Self) -> bool

Checks that the two slices are ASCII case-insensitively equal.

Source

pub const fn make_ascii_uppercase(&mut self)

Converts the slice to its ASCII uppercase equivalent in-place.

Source

pub const fn make_ascii_lowercase(&mut self)

Converts the slice to its ASCII lowercase equivalent in-place.

Source

pub const fn trim_ascii_start(&self) -> &[u8]

Returns new slice with leading ASCII whitespace bytes removed.

Source

pub const fn trim_ascii_end(&self) -> &[u8]

Returns new slice with trailing ASCII whitespace bytes removed.

Source

pub const fn trim_ascii(&self) -> &[u8]

Returns new slice with leading and trailing ASCII whitespace bytes removed.

Source

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.
Source§

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_vectored(&mut self, buffers: &[IoSlice<'_>]) -> Result<usize>

Like write, except that it writes from a slice of buffers. Read more
Source§

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<()>

Writes a formatted string into this writer, returning any error encountered. Read more
Source§

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

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more