Enum PayloadType
#[repr(u8)]pub enum PayloadType {
Empty = 255,
Unspecified = 0,
NodeIdentity = 1,
MacCommand = 2,
TextMessage = 3,
ChatRoomMessage = 5,
CoapOverUmsh = 7,
NodeManagement = 8,
}Expand description
Application payload type carried inside the MAC body.
Empty is a special out-of-band value used when the frame carries no
application payload bytes at all, meaning there is no payload-type byte on
the wire. All other variants correspond to the leading typed-payload byte.
Variants§
Empty = 255
No application payload and no payload-type byte on the wire.
Unspecified = 0
Explicit application-agnostic payload type byte 0.
NodeIdentity = 1
Node-identity payload.
MacCommand = 2
MAC command payload.
TextMessage = 3
Text-message payload.
ChatRoomMessage = 5
Chat-room management payload.
CoapOverUmsh = 7
CoAP-over-UMSH payload.
NodeManagement = 8
Node-management payload.
Implementations§
§impl PayloadType
impl PayloadType
pub fn from_byte(byte: u8) -> Option<PayloadType>
pub fn from_byte(byte: u8) -> Option<PayloadType>
Convert a raw payload-type byte into a known payload type.
pub fn allowed_for(self, packet_type: PacketType) -> bool
pub fn allowed_for(self, packet_type: PacketType) -> bool
Return whether this payload type is valid for the given MAC packet type.
Trait Implementations§
§impl Clone for PayloadType
impl Clone for PayloadType
§fn clone(&self) -> PayloadType
fn clone(&self) -> PayloadType
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for PayloadType
impl Debug for PayloadType
§impl PartialEq for PayloadType
impl PartialEq for PayloadType
impl Copy for PayloadType
impl Eq for PayloadType
impl StructuralPartialEq for PayloadType
Auto Trait Implementations§
impl Freeze for PayloadType
impl RefUnwindSafe for PayloadType
impl Send for PayloadType
impl Sync for PayloadType
impl Unpin for PayloadType
impl UnwindSafe for PayloadType
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)