Struct rings_node::backend::types::BackendMessage
source · pub struct BackendMessage {
pub message_type: MessageType,
pub extra: [u8; 30],
pub data: Vec<u8>,
}Expand description
BackendMessage struct for CustomMessage. A backend message body’s length at least is 32bytes;
message_type: [u8;2]extra data: [u8;30]message data: u8
Fields§
§message_type: MessageTypemessage_type
extra: [u8; 30]extra bytes
data: Vec<u8>data body
Implementations§
source§impl BackendMessage
impl BackendMessage
sourcepub fn new(message_type: MessageType, data: &[u8]) -> Self
pub fn new(message_type: MessageType, data: &[u8]) -> Self
generate new BackendMessage with
message_typedataextra will be [0u8;30]
Trait Implementations§
source§impl Clone for BackendMessage
impl Clone for BackendMessage
source§fn clone(&self) -> BackendMessage
fn clone(&self) -> BackendMessage
Returns a copy 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 BackendMessage
impl Debug for BackendMessage
source§impl From<BackendMessage> for Bytes
impl From<BackendMessage> for Bytes
source§fn from(v: BackendMessage) -> Self
fn from(v: BackendMessage) -> Self
Converts to this type from the input type.
source§impl From<BackendMessage> for Vec<u8>
impl From<BackendMessage> for Vec<u8>
source§fn from(v: BackendMessage) -> Self
fn from(v: BackendMessage) -> Self
Converts to this type from the input type.