#[repr(u8)]pub enum ResponseCode {
Ack = 6,
Nak = 21,
Busy = 225,
Unsupported = 226,
Unavailable = 227,
Collision = 228,
Reserved = 255,
}Expand description
Represents response code variants for reponse messages.
Variants§
Ack = 6
Affirmative response.
Nak = 21
Negative response.
Busy = 225
Device is handling another Message, no request acceptable.
Unsupported = 226
Unsupported Function Code, UID, and Request Message.
Device is not accepting requests.
Collision = 228
Message conflict, e.g. receiving a message in the middle of sending a message.
Reserved = 255
Reserved response code.
Implementations§
Source§impl ResponseCode
impl ResponseCode
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new ResponseCode.
Sourcepub const fn from_u8(val: u8) -> Self
pub const fn from_u8(val: u8) -> Self
Infallible conversion from a u8 into a ResponseCode.
Sourcepub const fn to_u8(&self) -> u8
pub const fn to_u8(&self) -> u8
Converts a ResponseCode into a u8.
Sourcepub const fn len() -> usize
pub const fn len() -> usize
Gets the length of the ResponseCode.
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Gets whether the ResponseCode contains a reserved variant.
Sourcepub const fn is_valid(&self) -> bool
pub const fn is_valid(&self) -> bool
Gets whether the ResponseCode is a valid variant.
Trait Implementations§
Source§impl Clone for ResponseCode
impl Clone for ResponseCode
Source§fn clone(&self) -> ResponseCode
fn clone(&self) -> ResponseCode
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 moreSource§impl Debug for ResponseCode
impl Debug for ResponseCode
Source§impl Default for ResponseCode
impl Default for ResponseCode
Source§impl Display for ResponseCode
impl Display for ResponseCode
Source§impl From<&ResponseCode> for &'static str
impl From<&ResponseCode> for &'static str
Source§fn from(val: &ResponseCode) -> Self
fn from(val: &ResponseCode) -> Self
Converts to this type from the input type.
Source§impl From<&ResponseCode> for u8
impl From<&ResponseCode> for u8
Source§fn from(val: &ResponseCode) -> Self
fn from(val: &ResponseCode) -> Self
Converts to this type from the input type.
Source§impl From<ResponseCode> for &'static str
impl From<ResponseCode> for &'static str
Source§fn from(val: ResponseCode) -> Self
fn from(val: ResponseCode) -> Self
Converts to this type from the input type.
Source§impl From<ResponseCode> for u8
impl From<ResponseCode> for u8
Source§fn from(val: ResponseCode) -> Self
fn from(val: ResponseCode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ResponseCode
impl PartialEq for ResponseCode
Source§impl TryFrom<u8> for ResponseCode
impl TryFrom<u8> for ResponseCode
impl Copy for ResponseCode
impl Eq for ResponseCode
impl StructuralPartialEq for ResponseCode
Auto Trait Implementations§
impl Freeze for ResponseCode
impl RefUnwindSafe for ResponseCode
impl Send for ResponseCode
impl Sync for ResponseCode
impl Unpin for ResponseCode
impl UnwindSafe for ResponseCode
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