pub enum PtpDomain {
DomainName {
name: String,
},
DomainNumber(u8),
}Expand description
PTP domain.
This deviates from the RFC 7273 grammar, which defines both variants
with domain-name= and domain-nmbr= prefixes and a domain name of
1-16 characters. None of the examples in the RFC use the prefixes, so
parsing follows the examples and accepts a bare domain name or a bare
domain number (0-127).
A domain name must be exactly 16 characters: a shorter one would be indistinguishable from a domain number when parsing the bare value.
Variants§
Implementations§
Source§impl PtpDomain
impl PtpDomain
Sourcepub fn try_from_number(number: u8) -> Result<Self, AttributeError>
pub fn try_from_number(number: u8) -> Result<Self, AttributeError>
Tries to construct a PtpDomain from the specified number.
Returns an Error if number is not in range (0-127) (inclusive)
Trait Implementations§
impl Eq for PtpDomain
impl StructuralPartialEq for PtpDomain
Auto Trait Implementations§
impl Freeze for PtpDomain
impl RefUnwindSafe for PtpDomain
impl Send for PtpDomain
impl Sync for PtpDomain
impl Unpin for PtpDomain
impl UnsafeUnpin for PtpDomain
impl UnwindSafe for PtpDomain
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