Struct sn_messaging::WireMsg [−][src]
pub struct WireMsg { /* fields omitted */ }Implementations
impl WireMsg[src]
impl WireMsg[src]pub fn new_ping_msg() -> 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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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
impl StructuralPartialEq for WireMsg[src]
Auto Trait Implementations
impl RefUnwindSafe for WireMsg
impl Send for WireMsg
impl Sync for WireMsg
impl Unpin for WireMsg
impl UnwindSafe for WireMsg
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,