Function try_into_bstr

Source
pub fn try_into_bstr<'a>(
    path: impl Into<Cow<'a, Path>>,
) -> Result<Cow<'a, BStr>, Utf8Error>
Expand description

Convert the given path either into its raw bytes on Unix or its UTF-8 encoded counterpart on Windows.

On Windows, if the source Path`` contains ill-formed, lone surrogates, the UTF-8 conversion will fail causing Utf8Error` to be returned.