[][src]Struct sv::messages::MessageHeader

pub struct MessageHeader {
    pub magic: [u8; 4],
    pub command: [u8; 12],
    pub payload_size: u32,
    pub checksum: [u8; 4],
}

Header that begins all messages

Fields

Magic bytes indicating the network type

Command name

Payload size

First 4 bytes of SHA256(SHA256(payload))

Methods

impl MessageHeader
[src]

Size of the message header in bytes

Returns the size of the header in bytes

Checks if the header is valid

magic - Expected magic bytes for the network max_size - Max size in bytes for the payload

Reads the payload and verifies its checksum

Trait Implementations

impl Serializable<MessageHeader> for MessageHeader
[src]

impl Clone for MessageHeader
[src]

Performs copy-assignment from source. Read more

impl Eq for MessageHeader
[src]

impl Default for MessageHeader
[src]

impl PartialEq<MessageHeader> for MessageHeader
[src]

impl Debug for MessageHeader
[src]

impl Hash for MessageHeader
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

Should always be Self