pub struct MessageParser;Expand description
Message parser for DCP protocol
Implementations§
Source§impl MessageParser
impl MessageParser
Sourcepub fn parse(bytes: &[u8]) -> Result<ParsedMessage<'_>, DCPError>
pub fn parse(bytes: &[u8]) -> Result<ParsedMessage<'_>, DCPError>
Parse a complete DCP message from bytes
Sourcepub fn validate_message_type(msg_type: u8) -> Result<MessageType, DCPError>
pub fn validate_message_type(msg_type: u8) -> Result<MessageType, DCPError>
Validate message type is known
Sourcepub fn validate_flags(flags: u8) -> Result<(), DCPError>
pub fn validate_flags(flags: u8) -> Result<(), DCPError>
Validate that only defined flag bits are set.
Sourcepub fn extract_flags(envelope: &BinaryMessageEnvelope) -> MessageFlags
pub fn extract_flags(envelope: &BinaryMessageEnvelope) -> MessageFlags
Extract flags from envelope
Auto Trait Implementations§
impl Freeze for MessageParser
impl RefUnwindSafe for MessageParser
impl Send for MessageParser
impl Sync for MessageParser
impl Unpin for MessageParser
impl UnsafeUnpin for MessageParser
impl UnwindSafe for MessageParser
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