Skip to main content

PythonWhitespace

Trait PythonWhitespace 

Source
pub trait PythonWhitespace {
    // Required methods
    fn trim_whitespace(&self) -> &Self;
    fn trim_whitespace_start(&self) -> &Self;
    fn trim_whitespace_end(&self) -> &Self;
}

Required Methods§

Source

fn trim_whitespace(&self) -> &Self

Like str::trim(), but only removes whitespace characters that Python considers to be whitespace.

Source

fn trim_whitespace_start(&self) -> &Self

Like str::trim_start(), but only removes whitespace characters that Python considers to be whitespace.

Source

fn trim_whitespace_end(&self) -> &Self

Like str::trim_end(), but only removes whitespace characters that Python considers to be whitespace.

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 PythonWhitespace for str

Source§

fn trim_whitespace(&self) -> &Self

Source§

fn trim_whitespace_start(&self) -> &Self

Source§

fn trim_whitespace_end(&self) -> &Self

Implementors§