pub struct BrowsableDeviceNumber(/* private fields */);Expand description
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. A device number in 1–4: the range a peer will actually browse.
This is a requirement, not a preference (F45). At device 5 a CDJ accepts an announcement completely — it puts the announcer in its device table and unicasts hundreds of status packets to it — and then never sends a single media query, so it never offers the announcer as a source. The check precedes the whole browse path and the failure is entirely silent: every later step still works and none of them is ever reached.
Having a distinct type means a server that can never be browsed cannot be configured. Where 1–4 are all taken, the answer is to degrade to an observer number with serving switched off, and the type system makes that an explicit decision rather than an accident.
Implementations§
Source§impl BrowsableDeviceNumber
impl BrowsableDeviceNumber
Sourcepub const fn new(raw: u8) -> Option<BrowsableDeviceNumber>
pub const fn new(raw: u8) -> Option<BrowsableDeviceNumber>
Parse a browsable device number, rejecting zero and anything above 4.
Sourcepub const fn number(self) -> DeviceNumber
pub const fn number(self) -> DeviceNumber
Widen to a plain device number.
Sourcepub fn descending() -> impl Iterator<Item = BrowsableDeviceNumber>
pub fn descending() -> impl Iterator<Item = BrowsableDeviceNumber>
Every browsable number, highest first.
Highest first because 1 and 2 are the decks a DJ reaches for, so a virtual CDJ should leave them alone as long as it can.
Trait Implementations§
Source§impl Clone for BrowsableDeviceNumber
impl Clone for BrowsableDeviceNumber
Source§fn clone(&self) -> BrowsableDeviceNumber
fn clone(&self) -> BrowsableDeviceNumber
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more