Struct bitcoin_netmsg::MessageHeader
source · pub struct MessageHeader { /* private fields */ }
Expand description
| Message header. | | (4) message start. | | (12) command. | | (4) size. | | (4) checksum. |
Implementations§
source§impl MessageHeader
impl MessageHeader
sourcepub fn new(
pch_message_start_in: &MessageHeaderMessageStartChars,
psz_command: *const u8,
n_message_size_in: u32
) -> Self
pub fn new( pch_message_start_in: &MessageHeaderMessageStartChars, psz_command: *const u8, n_message_size_in: u32 ) -> Self
| Construct a P2P message header from
| message-start characters, a command
| and the size of the message.
|
| ———–
| @note
|
| Passing in a pszCommand
longer than
| COMMAND_SIZE will result in a run-time
| assertion error.
|
pub fn get_command(&self) -> String
pub fn is_command_valid(&self) -> bool
Auto Trait Implementations§
impl RefUnwindSafe for MessageHeader
impl Send for MessageHeader
impl Sync for MessageHeader
impl Unpin for MessageHeader
impl UnwindSafe for MessageHeader
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more