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§
Sourcefn elements(&self) -> OsStrElements<'_> ⓘ
fn elements(&self) -> OsStrElements<'_> ⓘ
Iterate over the smallest elements of an OsStr. Element meaning is dependent on specific OS.
Provided Methods§
fn starts_with<T: AsRef<OsStr>>(&self, prefix: T) -> bool
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", so this trait is not object safe.