#[non_exhaustive]pub enum Error {
Show 14 variants
InvalidConfig(Cow<'static, str>),
Transport(TransportError),
HostKey(HostKeyError),
Authentication(AuthenticationError),
Channel(ChannelError),
CommandExit {
exit: CommandExit,
},
Sftp(SftpError),
Forwarding(ForwardingError),
Timeout(TimeoutError),
Cancelled(CancelledError),
Disconnected(DisconnectedError),
Unsupported(Cow<'static, str>),
Io(Error),
Ssh(SshError),
}Expand description
Error type used by russh-extra.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConfig(Cow<'static, str>)
A builder or parser received invalid configuration.
Transport(TransportError)
SSH transport failed.
HostKey(HostKeyError)
Host-key verification failed.
Authentication(AuthenticationError)
Authentication was rejected or could not be attempted.
Channel(ChannelError)
A channel could not be opened or used.
CommandExit
A remote command exited unsuccessfully.
Fields
exit: CommandExitReported remote command exit.
Sftp(SftpError)
SFTP operation failed.
Forwarding(ForwardingError)
Forwarding operation failed.
Timeout(TimeoutError)
Operation timed out.
Cancelled(CancelledError)
Operation was cancelled.
Disconnected(DisconnectedError)
Remote peer disconnected.
Unsupported(Cow<'static, str>)
A requested operation is not implemented or not supported.
Io(Error)
Local I/O failed.
Ssh(SshError)
An unclassified lower-level SSH error occurred.
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_config(message: impl Into<Cow<'static, str>>) -> Self
pub fn invalid_config(message: impl Into<Cow<'static, str>>) -> Self
Creates an invalid configuration error.
Sourcepub fn transport(
kind: TransportErrorKind,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn transport( kind: TransportErrorKind, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a transport error.
Sourcepub fn transport_with_source<E>(
kind: TransportErrorKind,
message: impl Into<Cow<'static, str>>,
source: E,
) -> Self
pub fn transport_with_source<E>( kind: TransportErrorKind, message: impl Into<Cow<'static, str>>, source: E, ) -> Self
Creates a transport error with a lower-level source.
Sourcepub fn host_key(
kind: HostKeyErrorKind,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn host_key( kind: HostKeyErrorKind, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a host-key verification error.
Sourcepub fn host_key_with_source<E>(
kind: HostKeyErrorKind,
message: impl Into<Cow<'static, str>>,
source: E,
) -> Self
pub fn host_key_with_source<E>( kind: HostKeyErrorKind, message: impl Into<Cow<'static, str>>, source: E, ) -> Self
Creates a host-key verification error with a lower-level source.
Sourcepub fn authentication(message: impl Into<Cow<'static, str>>) -> Self
pub fn authentication(message: impl Into<Cow<'static, str>>) -> Self
Creates an authentication error.
Sourcepub fn authentication_kind(
kind: AuthenticationErrorKind,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn authentication_kind( kind: AuthenticationErrorKind, message: impl Into<Cow<'static, str>>, ) -> Self
Creates an authentication error with a specific category.
Sourcepub fn authentication_with_source<E>(
kind: AuthenticationErrorKind,
message: impl Into<Cow<'static, str>>,
source: E,
) -> Self
pub fn authentication_with_source<E>( kind: AuthenticationErrorKind, message: impl Into<Cow<'static, str>>, source: E, ) -> Self
Creates an authentication error with a lower-level source.
Sourcepub fn channel_kind(
kind: ChannelErrorKind,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn channel_kind( kind: ChannelErrorKind, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a channel error with a specific category.
Sourcepub fn channel_with_source<E>(
kind: ChannelErrorKind,
message: impl Into<Cow<'static, str>>,
source: E,
) -> Self
pub fn channel_with_source<E>( kind: ChannelErrorKind, message: impl Into<Cow<'static, str>>, source: E, ) -> Self
Creates a channel error with a lower-level source.
Sourcepub fn command_exit(exit: CommandExit) -> Self
pub fn command_exit(exit: CommandExit) -> Self
Creates a remote command exit error.
Sourcepub fn sftp(kind: SftpErrorKind, message: impl Into<Cow<'static, str>>) -> Self
pub fn sftp(kind: SftpErrorKind, message: impl Into<Cow<'static, str>>) -> Self
Creates an SFTP error.
Sourcepub fn sftp_with_source<E>(
kind: SftpErrorKind,
message: impl Into<Cow<'static, str>>,
source: E,
) -> Self
pub fn sftp_with_source<E>( kind: SftpErrorKind, message: impl Into<Cow<'static, str>>, source: E, ) -> Self
Creates an SFTP error with a lower-level source.
Sourcepub fn forwarding(
kind: ForwardingErrorKind,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn forwarding( kind: ForwardingErrorKind, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a forwarding error.
Sourcepub fn forwarding_with_source<E>(
kind: ForwardingErrorKind,
source: E,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn forwarding_with_source<E>( kind: ForwardingErrorKind, source: E, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a forwarding error with a lower-level source.
Sourcepub fn timeout(
operation: Operation,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn timeout( operation: Operation, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a timeout error.
Sourcepub fn cancelled(
operation: Operation,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn cancelled( operation: Operation, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a cancellation error.
Sourcepub fn disconnected(
operation: Operation,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn disconnected( operation: Operation, message: impl Into<Cow<'static, str>>, ) -> Self
Creates a remote disconnect error.
Sourcepub fn unsupported(message: impl Into<Cow<'static, str>>) -> Self
pub fn unsupported(message: impl Into<Cow<'static, str>>) -> Self
Creates an unsupported operation error.
Sourcepub fn ssh_with_source<E>(
message: impl Into<Cow<'static, str>>,
source: E,
) -> Self
pub fn ssh_with_source<E>( message: impl Into<Cow<'static, str>>, source: E, ) -> Self
Creates an unclassified lower-level SSH error with a source.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns whether this error is a timeout.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns whether this error is a cancellation.
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Returns whether this error is a remote disconnect.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()