Struct utf8_command::StdoutError
source · pub struct StdoutError { /* private fields */ }
Expand description
The Output
’s stdout
field contained invalid UTF-8. Wraps a FromUtf8Error
.
use utf8_command::StdoutError;
let invalid_utf8 = Vec::from(b"\x80"); // Invalid single byte.
let inner_err = String::from_utf8(invalid_utf8).unwrap_err();
let err = StdoutError::from(inner_err);
assert_eq!(
err.to_string(),
"Stdout contained invalid utf-8 sequence of 1 bytes from index 0: \"�\""
);
Implementations§
source§impl StdoutError
impl StdoutError
sourcepub fn inner(&self) -> &FromUtf8Error
pub fn inner(&self) -> &FromUtf8Error
Get a reference to the inner FromUtf8Error
.
Trait Implementations§
source§impl Clone for StdoutError
impl Clone for StdoutError
source§fn clone(&self) -> StdoutError
fn clone(&self) -> StdoutError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StdoutError
impl Debug for StdoutError
source§impl Display for StdoutError
impl Display for StdoutError
source§impl Error for StdoutError
impl Error for StdoutError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 From<FromUtf8Error> for StdoutError
impl From<FromUtf8Error> for StdoutError
source§fn from(inner: FromUtf8Error) -> Self
fn from(inner: FromUtf8Error) -> Self
Converts to this type from the input type.
source§impl From<StdoutError> for Error
impl From<StdoutError> for Error
source§fn from(value: StdoutError) -> Self
fn from(value: StdoutError) -> Self
Converts to this type from the input type.
source§impl From<StdoutError> for FromUtf8Error
impl From<StdoutError> for FromUtf8Error
source§fn from(value: StdoutError) -> Self
fn from(value: StdoutError) -> Self
Converts to this type from the input type.
source§impl PartialEq for StdoutError
impl PartialEq for StdoutError
source§fn eq(&self, other: &StdoutError) -> bool
fn eq(&self, other: &StdoutError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for StdoutError
impl StructuralPartialEq for StdoutError
Auto Trait Implementations§
impl Freeze for StdoutError
impl RefUnwindSafe for StdoutError
impl Send for StdoutError
impl Sync for StdoutError
impl Unpin for StdoutError
impl UnwindSafe for StdoutError
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