Skip to main content

Error

Enum Error 

Source
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.

Fields

§context: &'static str

What was being attempted.

§source: Error

The underlying failure.

§

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.

Fields

§name: String

The name that was asked for.

§

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.

Fields

§path: PathBuf

Where the stick is mounted.

§

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).

Fields

§taken: Vec<u8>

The numbers observed in use.

§

NumberConflict

Another device defended the number we were claiming, and we ran out of candidates.

Fields

§number: DeviceNumber

The number we wanted.

§holder: Ipv4Addr

Who defended it.

§

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

§port: u16

The port that could not be bound.

§source: Error

What the operating system said.

§remedy: &'static str

What a user can do about it on this platform.

§

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.

Fields

§port: u16

The port a media query needs.

§

Timeout

A peer stopped answering.

Fields

§what: &'static str

What we were waiting for.

§after: Duration

How long we waited.

§

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

§operation: &'static str

Which procedure failed.

§path: String

The path or export it was called on.

§status: ErrorStatus

What 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.

Fields

§what: &'static str

What was being attempted.

§detail: String

What the peer said, in whatever terms its layer has.

Implementations§

Source§

impl Error

Source

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 Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CustomError for T
where T: Display + Debug + Send + Sync + 'static,

Source§

fn as_any(&self) -> &(dyn Any + Sync + Send + 'static)

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + Sync + Send + 'static)

Source§

fn as_box_any(self: Box<T>) -> Box<dyn Any + Sync + Send>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more