Skip to main content

OsStrGenericExt

Trait OsStrGenericExt 

Source
pub trait OsStrGenericExt {
    // Required method
    fn elements(&self) -> OsStrElements<'_> ;

    // Provided methods
    fn starts_with<T: AsRef<OsStr>>(&self, prefix: T) -> bool { ... }
    fn without_prefix<T: AsRef<OsStr>>(&self, prefix: T) -> Option<OsString> { ... }
}
Expand description

Extentions to OsStr that allow working with them without filling code with #[cfg(...)]

Required Methods§

Source

fn elements(&self) -> OsStrElements<'_>

Iterate over the smallest elements of an OsStr. Element meaning is dependent on specific OS.

Provided Methods§

Source

fn starts_with<T: AsRef<OsStr>>(&self, prefix: T) -> bool

Source

fn without_prefix<T: AsRef<OsStr>>(&self, prefix: T) -> Option<OsString>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl OsStrGenericExt for OsStr

Implementors§