#[non_exhaustive]pub enum Error {
Show 37 variants
Identity {
detail: String,
},
PortInUse {
port: u16,
},
Listen {
port: u16,
detail: String,
},
DiscoveryUnavailable {
detail: String,
},
TrustStore {
detail: String,
},
InvalidFingerprint,
NotListed,
AllowNotDefault,
DeviceNearby,
DeviceNotNearby,
DeviceBlocked,
NoUsableAddress,
InvalidIdentity {
peer: String,
},
PeerPlaintext {
peer: String,
},
PeerIdentityMismatch {
peer: String,
},
PeerUnreachable {
peer: String,
detail: String,
},
PeerLost {
peer: String,
detail: String,
},
PeerAnswer {
peer: String,
status: u16,
},
PeerReply {
peer: String,
},
PeerNeedsPin {
peer: String,
},
PeerBusy {
peer: String,
},
PeerTooLarge {
peer: String,
},
PeerRateLimited {
peer: String,
},
FileRefused {
peer: String,
file: String,
},
FileDamaged {
peer: String,
file: String,
},
FileStopped {
file: String,
detail: String,
},
TooManyFiles {
max: usize,
},
NothingToSend,
NotFileOrFolder {
path: String,
},
Damaged {
file: String,
},
Internal {
detail: String,
},
Unreadable {
path: String,
detail: String,
},
SenderStopped,
Unverified {
max_files: usize,
max_bytes: u64,
},
SaveFailed {
file: String,
detail: String,
},
Interrupted {
file: String,
detail: String,
},
Mark {
file: String,
detail: String,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Identity
The stored certificate and key do not form a usable identity.
PortInUse
The listen port is held by another program.
Listen
The listen port could not be bound for another reason.
The discovery socket could not be opened; devices that find this one first still work.
TrustStore
The device list could not be written to the trust store path.
InvalidFingerprint
A device key was not a 64-character SHA-256 in hex.
NotListed
A device record was asked for that has no record.
AllowNotDefault
The default state was set to Allow; only single devices may be allowed.
DeviceNearby
Forgetting a record is refused while that device is on the network.
DeviceNotNearby
The send target is not on the network.
DeviceBlocked
The send target is set to Deny.
NoUsableAddress
The device announced no usable address.
InvalidIdentity
The device’s identity is not a valid fingerprint.
PeerPlaintext
The device answered over plain HTTP. Sends are refused without TLS.
PeerIdentityMismatch
The certificate the device presented is not the one its fingerprint names. Distinct from an unreachable device: the address answered with another key.
PeerUnreachable
The device could not be connected to.
PeerLost
The connection to the device failed after it was made.
PeerAnswer
The device answered with a status the protocol does not define here.
PeerReply
The device’s answer could not be parsed.
PeerNeedsPin
The device asks for a PIN, which is not supported.
PeerBusy
The device is busy with another transfer.
PeerTooLarge
The device refused the request as too large for an unproven sender.
PeerRateLimited
The device is rate limiting requests.
FileRefused
The device refused one file.
FileDamaged
The device reported that one file arrived damaged.
FileStopped
Sending one file stopped.
TooManyFiles
More entries than the send limit.
NothingToSend
Nothing to send after expanding the selection.
NotFileOrFolder
A chosen path is neither a file nor a folder.
Damaged
A received file’s checksum did not match the one the sender named.
Internal
An internal failure that should not happen (serializing our own message).
Unreadable
A chosen path could not be read.
SenderStopped
The sender stopped responding while a transfer was open.
Unverified
A request from an unproven sender named too much (receive side).
SaveFailed
A received file could not be saved.
Interrupted
A received file was cut off mid-transfer.
Mark
A received file could not be marked as coming from outside the computer. An unproven sender’s file is then not kept.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()