pub struct FromOsStrError(/* private fields */);
Expand description
A possible error value while converting a OsStr
to a Utf8Path
.
Produced by the TryFrom<&OsStr>
implementation for &Utf8Path
.
§Examples
use camino::{Utf8Path, FromOsStrError};
use std::convert::{TryFrom, TryInto};
use std::ffi::OsStr;
use std::os::unix::ffi::OsStrExt;
let unicode_str = OsStr::new("/valid/unicode");
let utf8_path: &Utf8Path = unicode_str.try_into().expect("valid Unicode path succeeded");
// Paths on Unix can be non-UTF-8.
let non_unicode_str = OsStr::from_bytes(b"\xFF\xFF\xFF");
let err: FromOsStrError = <&Utf8Path>::try_from(non_unicode_str)
.expect_err("non-Unicode path failed");
Implementations§
Source§impl FromOsStrError
impl FromOsStrError
Sourcepub fn into_io_error(self) -> Error
pub fn into_io_error(self) -> Error
Converts self into a std::io::Error
with kind
InvalidData
.
Many users of FromOsStrError
will want to convert it into an io::Error
. This is a
convenience method to do that.
Trait Implementations§
Source§impl Clone for FromOsStrError
impl Clone for FromOsStrError
Source§fn clone(&self) -> FromOsStrError
fn clone(&self) -> FromOsStrError
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FromOsStrError
impl Debug for FromOsStrError
Source§impl Display for FromOsStrError
impl Display for FromOsStrError
Source§impl Error for FromOsStrError
impl Error for FromOsStrError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for FromOsStrError
impl PartialEq for FromOsStrError
impl Copy for FromOsStrError
impl Eq for FromOsStrError
impl StructuralPartialEq for FromOsStrError
Auto Trait Implementations§
impl Freeze for FromOsStrError
impl RefUnwindSafe for FromOsStrError
impl Send for FromOsStrError
impl Sync for FromOsStrError
impl Unpin for FromOsStrError
impl UnwindSafe for FromOsStrError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more