pub enum Message {
BasicId(BasicId),
Location(Location),
Auth(Auth),
SelfId(SelfId),
System(System),
OperatorId(OperatorId),
}Expand description
One decoded Remote ID message.
Variants§
BasicId(BasicId)
Basic ID.
Location(Location)
Location and vector.
Auth(Auth)
One authentication page.
SelfId(SelfId)
Self ID.
System(System)
System.
OperatorId(OperatorId)
Operator ID.
Implementations§
Source§impl Message
impl Message
Sourcepub fn decode(data: &[u8]) -> Result<Self, Error>
pub fn decode(data: &[u8]) -> Result<Self, Error>
Decodes one message from the first MESSAGE_SIZE bytes of data.
A message pack header is rejected here; use crate::Frame::decode
or crate::MessagePack::parse for packs.
Sourcepub fn encode(&self) -> Result<[u8; 25], Error>
pub fn encode(&self) -> Result<[u8; 25], Error>
Encodes the message into its 25 byte broadcast form.
Sourcepub fn message_type(&self) -> MessageType
pub fn message_type(&self) -> MessageType
The message type.
Sourcepub fn protocol_version(&self) -> u8
pub fn protocol_version(&self) -> u8
The protocol version from the message header.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Message
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Forget for Message
impl Freeze for Message
impl Move for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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