pub struct SftpError {
pub code: StatusCode,
pub message: String,
}Expand description
Error type for SFTP operations.
This wrapper type converts to StatusCode for the SFTP handler trait.
Fields§
§code: StatusCodeThe status code for the error.
message: StringHuman-readable error message.
Implementations§
Source§impl SftpError
impl SftpError
Sourcepub fn new(code: StatusCode, message: impl Into<String>) -> Self
pub fn new(code: StatusCode, message: impl Into<String>) -> Self
Create a new SFTP error.
Sourcepub fn not_supported() -> Self
pub fn not_supported() -> Self
Create an “operation not supported” error.
Sourcepub fn no_such_file(path: &Path) -> Self
pub fn no_such_file(path: &Path) -> Self
Create a “no such file” error.
Sourcepub fn permission_denied(message: impl Into<String>) -> Self
pub fn permission_denied(message: impl Into<String>) -> Self
Create a “permission denied” error.
Sourcepub fn invalid_handle() -> Self
pub fn invalid_handle() -> Self
Create an “invalid handle” error.
Trait Implementations§
Source§impl Error for SftpError
impl Error for SftpError
1.30.0 · 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<SftpError> for StatusCode
impl From<SftpError> for StatusCode
Auto Trait Implementations§
impl Freeze for SftpError
impl RefUnwindSafe for SftpError
impl Send for SftpError
impl Sync for SftpError
impl Unpin for SftpError
impl UnsafeUnpin for SftpError
impl UnwindSafe for SftpError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Colorize for Twhere
T: Display,
impl<T> Colorize for Twhere
T: Display,
fn styled_for( &self, ansi_code: &'static str, stream: OutputStream, ) -> StyledText
fn styled(&self, ansi_code: &'static str) -> StyledText
fn red(&self) -> StyledText
fn red_stderr(&self) -> StyledText
fn green(&self) -> StyledText
fn yellow(&self) -> StyledText
fn blue(&self) -> StyledText
fn cyan(&self) -> StyledText
fn bright_blue(&self) -> StyledText
fn bold(&self) -> StyledText
fn dimmed(&self) -> StyledText
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more