pub struct BaseMessage {
pub msg_type: MessageType,
pub id: u16,
pub refers_to: u16,
pub sent: Timeval,
pub received: Timeval,
pub size: u32,
}Expand description
Base message header (26 bytes).
Every Snapcast protocol message starts with this header, followed by
size bytes of typed payload.
Fields§
§msg_type: MessageTypeType of the message payload.
id: u16Sequence identifier.
refers_to: u16ID of the message this is a response to.
sent: TimevalTimestamp when the message was sent.
received: TimevalTimestamp when the message was received.
size: u32Size of the payload in bytes.
Implementations§
Source§impl BaseMessage
impl BaseMessage
Sourcepub const HEADER_SIZE: usize = 26
pub const HEADER_SIZE: usize = 26
Size of the serialized header in bytes.
Sourcepub fn read_from<R: Read>(r: &mut R) -> Result<Self, ProtoError>
pub fn read_from<R: Read>(r: &mut R) -> Result<Self, ProtoError>
Deserialize a base message header from a reader.
Trait Implementations§
Source§impl Clone for BaseMessage
impl Clone for BaseMessage
Source§fn clone(&self) -> BaseMessage
fn clone(&self) -> BaseMessage
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 BaseMessage
impl Debug for BaseMessage
Source§impl PartialEq for BaseMessage
impl PartialEq for BaseMessage
impl Eq for BaseMessage
impl StructuralPartialEq for BaseMessage
Auto Trait Implementations§
impl Freeze for BaseMessage
impl RefUnwindSafe for BaseMessage
impl Send for BaseMessage
impl Sync for BaseMessage
impl Unpin for BaseMessage
impl UnsafeUnpin for BaseMessage
impl UnwindSafe for BaseMessage
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