Struct sn_messaging::WireMsg [−][src]
pub struct WireMsg { /* fields omitted */ }
Implementations
impl WireMsg
[src]
impl WireMsg
[src]pub fn new_ping_msg(dest: XorName, dest_section_pk: PublicKey) -> Self
[src]
pub fn new_ping_msg(dest: XorName, dest_section_pk: PublicKey) -> Self
[src]Creates a new instance of a ‘Ping’ message.
pub fn new_section_info_msg(
query: &Message,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Self>
[src]
pub fn new_section_info_msg(
query: &Message,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Self>
[src]Creates a new instance keeping a (serialized) copy of the ‘SectionInfo’ message provided.
pub fn new_client_msg(
msg: &ClientMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Self>
[src]
pub fn new_client_msg(
msg: &ClientMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Self>
[src]Creates a new instance keeping a (serialized) copy of the client ‘Message’ message provided.
pub fn new_routing_msg(
msg: &RoutingMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Self>
[src]
pub fn new_routing_msg(
msg: &RoutingMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Self>
[src]Creates a new instance keeping a (serialized) copy of the node ‘Message’ message provided.
pub fn new_node_msg(
msg: &NodeMsg,
dest: XorName,
dest_section_pk: PublicKey,
src_section_pk: Option<PublicKey>
) -> Result<Self>
[src]
pub fn new_node_msg(
msg: &NodeMsg,
dest: XorName,
dest_section_pk: PublicKey,
src_section_pk: Option<PublicKey>
) -> Result<Self>
[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 dest_section_pk(&self) -> PublicKey
[src]
pub fn dest_section_pk(&self) -> PublicKey
[src]Return the destination section PublicKey for this message
pub fn src_section_pk(&self) -> Option<PublicKey>
[src]
pub fn src_section_pk(&self) -> Option<PublicKey>
[src]Return the source section PublicKey for this message if it’s a NodeMsg and it was provided in the header of message.
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_section_info_msg(
query: &Message,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Bytes>
[src]
pub fn serialize_section_info_msg(
query: &Message,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Bytes>
[src]Convenience function which creates a temporary WireMsg from the provided MsgEnvelope, returning the serialized WireMsg.
pub fn serialize_client_msg(
msg: &ClientMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Bytes>
[src]
pub fn serialize_client_msg(
msg: &ClientMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Bytes>
[src]Convenience function which creates a temporary WireMsg from the provided Message, returning the serialized WireMsg.
pub fn serialize_routing_msg(
msg: &RoutingMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> Result<Bytes>
[src]
pub fn serialize_routing_msg(
msg: &RoutingMsg,
dest: XorName,
dest_section_pk: PublicKey
) -> 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 T
type Output = T
type Output = T
Should 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>,