pub struct DcsCode(/* private fields */);Expand description
Validated DCS code (index into DCS_CODES).
Wraps a u8 index in the range 0..=103. Use DcsCode::code_value
to look up the corresponding DCS code number.
Implementations§
Source§impl DcsCode
impl DcsCode
Sourcepub const fn new(index: u8) -> Result<Self, ValidationError>
pub const fn new(index: u8) -> Result<Self, ValidationError>
Creates a new DcsCode from a raw index.
§Errors
Returns ValidationError::DcsCodeInvalid if index >= 104.
Sourcepub const fn code_value(self) -> u16
pub const fn code_value(self) -> u16
Returns the DCS code value for this index.
Trait Implementations§
impl Copy for DcsCode
impl Eq for DcsCode
impl StructuralPartialEq for DcsCode
Auto Trait Implementations§
impl Freeze for DcsCode
impl RefUnwindSafe for DcsCode
impl Send for DcsCode
impl Sync for DcsCode
impl Unpin for DcsCode
impl UnwindSafe for DcsCode
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