AsciiExt

Trait AsciiExt 

Source
pub trait AsciiExt {
    // Required methods
    fn split_once<F>(&self, separator: F) -> Option<(Self, Self)>
       where F: FnMut(u8) -> bool,
             Self: Sized;
    fn trim_ascii_start(&self) -> Self;
    fn trim_ascii_end(&self) -> Self;

    // Provided method
    fn trim_ascii(&self) -> Self
       where Self: Sized { ... }
}
Expand description

ASCII extensions.

Required Methods§

Source

fn split_once<F>(&self, separator: F) -> Option<(Self, Self)>
where F: FnMut(u8) -> bool, Self: Sized,

Split the current slice once by a given separator predicate.

Source

fn trim_ascii_start(&self) -> Self

Trim ASCII whitespace from the start of the current slice.

Source

fn trim_ascii_end(&self) -> Self

Trim ASCII whitespace from the end of the current slice.

Provided Methods§

Source

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

Trim ASCII whitespace from both ends of the current slice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AsciiExt for Bytes

Source§

fn split_once<F>(&self, pred: F) -> Option<(Self, Self)>
where F: FnMut(u8) -> bool,

Source§

fn trim_ascii_start(&self) -> Self

Source§

fn trim_ascii_end(&self) -> Self

Implementors§