pub struct Error { /* private fields */ }Expand description
A failure produced by conpty-oxide.
The representation is intentionally private. Use Error::kind for
control flow, Error::io_error for a directly held OS error, and
Error::backend_error for backend initialization details.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn kind(&self) -> ErrorKind
pub const fn kind(&self) -> ErrorKind
Returns the stable classification of this failure.
§Examples
use conpty_oxide::blocking::Command;
if let Err(error) = Command::new("does-not-exist.exe").spawn() {
eprintln!("{:?}: {error}", error.kind());
}Sourcepub const fn io_error(&self) -> Option<&Error>
pub const fn io_error(&self) -> Option<&Error>
Returns the directly held I/O error, when this failure has one.
This does not walk the source chain. In particular, a backend failure
returns None; call Error::backend_error and then
BackendError::io_error for that case.
Sourcepub const fn backend_error(&self) -> Option<&BackendError>
pub const fn backend_error(&self) -> Option<&BackendError>
Returns the backend failure when initialization or validation failed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 From<BackendError> for Error
impl From<BackendError> for Error
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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