pub enum Error {
InvalidData {
message: String,
},
Protocol {
status: NtStatus,
command: Command,
},
Auth {
message: String,
},
Io(Error),
Timeout,
Disconnected,
DfsReferralRequired {
path: String,
},
Cancelled,
SessionExpired,
FileTooLargeForSingleRead {
size: u64,
max_read: u32,
},
}Expand description
Top-level error type for SMB2 operations.
Variants§
InvalidData
The data is malformed or does not match the expected format.
Protocol
The server returned a non-success NTSTATUS.
Fields
Auth
Authentication failed.
Io(Error)
An I/O or transport error occurred.
Timeout
The operation timed out.
Disconnected
The connection was lost.
DfsReferralRequired
The path requires DFS referral resolution.
The server returned STATUS_PATH_NOT_COVERED, meaning this path
lives on a different server via DFS. The caller can query for a
referral or display a helpful message.
Cancelled
The operation was cancelled by the caller (via progress callback).
SessionExpired
The session expired and reauthentication failed.
The pipeline normally handles STATUS_NETWORK_SESSION_EXPIRED
transparently by reauthenticating. This error surfaces only
when reauthentication itself fails.
FileTooLargeForSingleRead
The file is larger than a single READ can return, so a one-shot read would truncate it.
Returned by Tree::read_file and
Tree::read_file_compound when the
file’s size exceeds the server’s negotiated per-READ maximum
(MaxReadSize). Those paths issue a single READ, so a larger file can’t
come back whole — rather than silently dropping the tail, they fail with
this. Switch to Tree::read_file_pipelined,
which reads the whole file in a sliding window of chunked READs
regardless of size. Classifies as ErrorKind::TooLarge.
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_data(msg: impl Into<String>) -> Self
pub fn invalid_data(msg: impl Into<String>) -> Self
Create an InvalidData error with the given message.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if this error is potentially transient and
the operation could succeed on retry.
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()