pub enum Error {
Show 15 variants
Io {
context: &'static str,
source: Error,
},
Interfaces(String),
NoSuchInterface {
name: String,
},
NoUsableInterface,
NothingToServe,
NoMusic {
path: PathBuf,
},
Protocol(Error),
Medium(Error),
NoBrowsableNumber {
taken: Vec<u8>,
},
NumberConflict {
number: DeviceNumber,
holder: Ipv4Addr,
},
PrivilegedPort {
port: u16,
source: Error,
remedy: &'static str,
},
NoStatusPort {
port: u16,
},
Timeout {
what: &'static str,
after: Duration,
},
Nfs {
operation: &'static str,
path: String,
status: ErrorStatus,
},
Refused {
what: &'static str,
detail: String,
},
}Expand description
An error from the Pro DJ Link runtime.
Variants§
Io
A socket operation failed.
Interfaces(String)
The system’s interface list could not be read.
NoSuchInterface
The named interface does not exist, or has no IPv4 address and MAC.
NoUsableInterface
Nothing on this host could carry Pro DJ Link traffic.
NothingToServe
A server was asked to serve no media.
An error rather than an empty server, because a device that advertises no slots is one no player will ever ask about (F24), so it would sit there looking correct and doing nothing.
NoMusic
A stick with no rekordbox library and nothing on it a player could play: no MP3, AAC, WAV or AIFF file anywhere a walk reaches.
Protocol(Error)
A peer sent something this crate could not decode.
Medium(Error)
A file on a rekordbox medium could not be read.
NoBrowsableNumber
Every device number a peer would browse is taken.
Serving is impossible in this state. The right response is to degrade to an observer number with serving switched off, which is why this is an error the caller has to handle rather than a silent fallback (F45).
NumberConflict
Another device defended the number we were claiming, and we ran out of candidates.
PrivilegedPort
A port serving requires could not be bound.
Only UDP/111 is in this position. With nothing there a deck retries
GETPORT once a second indefinitely, never falls back to the well-known
ports, and so never lists us at all (F46) — so this is a hard failure
rather than a warning. It carries its own variant because the remedy is
platform-specific and belongs in front of a user rather than in a log.
Fields
NoStatusPort
Asking a peer about its slots needs UDP 50002, and this device does not hold it.
A media response is sent to the port it was asked from, and only one
socket in a SO_REUSEPORT group receives a given unicast datagram — so
a virtual CDJ started with emit_status: false, which is how a
crate::Monitor is given the port instead, cannot ask. Two things
wanting one port is a configuration mistake rather than a failure to
retry, which is why it is not a timeout.
Timeout
A peer stopped answering.
Nfs
A peer answered a file-access call with a filesystem status.
A well-formed reply reporting a failure, not a decoding failure, and the
status is the whole of what a caller can act on:
ACCES on MNT
means “announce first” rather than “give up” (F12),
NOENT on a LOOKUP may
mean the medium spells the name differently from its own database (O6),
and STALE means the mount
has to be redone.
Fields
status: ErrorStatusWhat the peer reported.
Refused
A peer understood a request and would not answer it.
Distinct from Error::Protocol, which means the bytes did not decode
at all: this one is a peer that is speaking the protocol and saying no.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_stale(&self) -> bool
pub fn is_stale(&self) -> bool
Whether a peer said its filehandles no longer refer to anything.
The one NFS status with a defined remedy: re-MNT and walk again,
once (F28). Worth asking here rather than making every caller match on
the variant, because getting it wrong means either an unrecoverable
transfer or a loop against a genuinely missing file.
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()