Struct ssh2_patched::Error
source · [−]pub struct Error { /* private fields */ }
Expand description
Representation of an error that can occur within libssh2
Implementations
sourceimpl Error
impl Error
sourcepub fn from_session_error(sess: &Session, rc: c_int) -> Error
pub fn from_session_error(sess: &Session, rc: c_int) -> Error
Given a libssh2 error return code, generate an Error object that encapsulates that error code and the error reason. The error reason is extracted from the Session and is used if the session contains the same error code as that provided. If the error code doesn’t match then an approximation of the error reason is used instead of the error message stored in the Session.
sourcepub fn last_session_error(sess: &Session) -> Option<Error>
pub fn last_session_error(sess: &Session) -> Option<Error>
Generate the last error that occurred for a Session
.
Returns None
if there was no last error.
sourcepub fn new(code: ErrorCode, msg: &'static str) -> Error
pub fn new(code: ErrorCode, msg: &'static str) -> Error
Create a new error for the given code and message
sourcepub fn from_errno(code: ErrorCode) -> Error
pub fn from_errno(code: ErrorCode) -> Error
Construct an error from an error code from libssh2
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more