Enum ProtocolKind
#[non_exhaustive]pub enum ProtocolKind {
DPlus,
DExtra,
Dcs,
}Expand description
D-STAR reflector protocol discriminator.
Runtime mirror of the compile-time Protocol marker traits.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DPlus
DPlus (REF reflectors, UDP port 20001 + TCP auth).
DExtra
DExtra (XRF/XLX reflectors, UDP port 30001).
Dcs
DCS (DCS reflectors, UDP port 30051).
Implementations§
§impl ProtocolKind
impl ProtocolKind
pub const fn default_port(self) -> u16
pub const fn default_port(self) -> u16
Default UDP port for this protocol.
Per ircDDBGateway/Common/DStarDefines.h:115-117.
pub const fn needs_auth(self) -> bool
pub const fn needs_auth(self) -> bool
Whether this protocol requires TCP authentication before UDP linking.
Only DPlus requires this — see
ircDDBGateway/Common/DPlusAuthenticator.cpp:62-200.
pub fn from_reflector_prefix(name: &str) -> Option<ProtocolKind>
pub fn from_reflector_prefix(name: &str) -> Option<ProtocolKind>
Identify the protocol from a reflector callsign prefix.
Examines the first three characters (case-insensitive):
"XRF"or"XLX"→ProtocolKind::DExtra"REF"→ProtocolKind::DPlus"DCS"→ProtocolKind::Dcs
Returns None for any other prefix or input shorter than 3 ASCII chars.
Trait Implementations§
§impl Clone for ProtocolKind
impl Clone for ProtocolKind
§fn clone(&self) -> ProtocolKind
fn clone(&self) -> ProtocolKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ProtocolKind
impl Debug for ProtocolKind
§impl Hash for ProtocolKind
impl Hash for ProtocolKind
§impl PartialEq for ProtocolKind
impl PartialEq for ProtocolKind
impl Copy for ProtocolKind
impl Eq for ProtocolKind
impl StructuralPartialEq for ProtocolKind
Auto Trait Implementations§
impl Freeze for ProtocolKind
impl RefUnwindSafe for ProtocolKind
impl Send for ProtocolKind
impl Sync for ProtocolKind
impl Unpin for ProtocolKind
impl UnwindSafe for ProtocolKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more