Struct sn_messaging::WireMsg [−][src]
pub struct WireMsg { /* fields omitted */ }
Implementations
impl WireMsg
[src]
impl WireMsg
[src]pub fn new_ping_msg() -> WireMsg
[src]
Creates a new instance of a ‘Ping’ message.
pub fn new_sectioninfo_msg(query: &Message) -> Result<WireMsg>
[src]
Creates a new instance keeping a (serialized) copy of the ‘SectionInfo’ message provided.
pub fn new_client_msg(msg: &Message) -> Result<WireMsg>
[src]
Creates a new instance keeping a (serialized) copy of the client ‘Message’ message provided.
pub fn new_node_msg(msg: &NodeMessage) -> Result<WireMsg>
[src]
Creates a new instance keeping a (serialized) copy of the node ‘Message’ message provided.
pub fn from(bytes: Bytes) -> Result<Self>
[src]
Attempts to create an instance of WireMsg by deserialising the bytes provided. To succeed, the bytes should contain at least a valid WireMsgHeader.
pub fn serialize(&self) -> Result<Bytes>
[src]
Return the serialized WireMsg, which contains the WireMsgHeader bytes, followed by the payload bytes, i.e. the serialized Message.
pub fn to_message(&self) -> Result<MessageType>
[src]
Deserialize the payload from this WireMsg returning a Message instance.
pub fn deserialize(bytes: Bytes) -> Result<MessageType>
[src]
Convenience function which creates a temporary WireMsg from the provided bytes, returning the deserialized message.
pub fn serialize_sectioninfo_msg(query: &Message) -> Result<Bytes>
[src]
Convenience function which creates a temporary WireMsg from the provided MsgEnvelope, returning the serialized WireMsg.
pub fn serialize_client_msg(msg: &Message) -> Result<Bytes>
[src]
Convenience function which creates a temporary WireMsg from the provided Message, returning the serialized WireMsg.
pub fn serialize_node_msg(msg: &NodeMessage) -> Result<Bytes>
[src]
Convenience function which creates a temporary WireMsg from the provided node::Messsage, returning the serialized WireMsg.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WireMsg
impl RefUnwindSafe for WireMsg
impl UnwindSafe for WireMsg
impl UnwindSafe for WireMsg