pub trait FromStableEncoding {
// Required method
unsafe fn from_stable_encoding<'a>(
encoded: impl Into<Cow<'a, [EncodingWidth]>>,
) -> Self;
}Expand description
Crates an OsString from an encoding that is stable across rust compiler versions, bypassing data copies if possible
Required Methods§
Sourceunsafe fn from_stable_encoding<'a>(
encoded: impl Into<Cow<'a, [EncodingWidth]>>,
) -> Self
unsafe fn from_stable_encoding<'a>( encoded: impl Into<Cow<'a, [EncodingWidth]>>, ) -> Self
Converts an OsString from an encoding that is stable across rust compiler versions, bypassing data copies if possible
This takes Into<Cow<[EncodingWidth]>> so that either a slice can be passed (which always allocates and copies data) or a vec can be passed (which might be able to skip allocating and copying data)
§Safety
The given bytes must be compatible with the underlying of the platform’s OsStr encoding (reminder: this crate only make it safe to pass data between different rust versions)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".