Struct zenoh_flow_nodes::prelude::LinkMessage
source · pub struct LinkMessage { /* private fields */ }Implementations§
source§impl LinkMessage
impl LinkMessage
pub fn new(payload: Payload, timestamp: Timestamp) -> Self
sourcepub fn new_serialized(data: Vec<u8>, timestamp: Timestamp) -> Self
pub fn new_serialized(data: Vec<u8>, timestamp: Timestamp) -> Self
Creates a new message from serialised data.
This is used when the message is coming from Zenoh or from a non-rust node.
sourcepub fn get_timestamp(&self) -> &Timestamp
pub fn get_timestamp(&self) -> &Timestamp
Return the Timestamp associated with this message.
sourcepub fn serialize_bincode_into(
&self,
message_buffer: &mut Vec<u8>,
payload_buffer: &mut Vec<u8>
) -> Result<()>
pub fn serialize_bincode_into( &self, message_buffer: &mut Vec<u8>, payload_buffer: &mut Vec<u8> ) -> Result<()>
Serialises the LinkMessage using bincode into the given buffer.
The inner_buffer is used to serialise (if need be) the Payload contained inside the
LinkMessage.
§Performance
The provided buffer and inner_buffer are reused and cleared between calls, so once their
capacity stabilises no (re)allocation is performed.
§Errors
An error variant is returned in case of:
- fails to serialise
Methods from Deref<Target = Payload>§
sourcepub fn try_as_bytes_into(&self, buffer: &mut Vec<u8>) -> Result<()>
pub fn try_as_bytes_into(&self, buffer: &mut Vec<u8>) -> Result<()>
Populate buffer with the bytes representation of the Payload.
§Performance
This method will serialise the Payload if it is Typed. Otherwise, the bytes
representation is simply cloned.
The provided buffer is reused and cleared between calls, so once its capacity stabilises
no more allocation is performed.
Trait Implementations§
source§impl Clone for LinkMessage
impl Clone for LinkMessage
source§fn clone(&self) -> LinkMessage
fn clone(&self) -> LinkMessage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LinkMessage
impl Debug for LinkMessage
source§impl Deref for LinkMessage
impl Deref for LinkMessage
source§impl<'de> Deserialize<'de> for LinkMessage
impl<'de> Deserialize<'de> for LinkMessage
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<LinkMessage> for Payload
impl From<LinkMessage> for Payload
source§fn from(data_message: LinkMessage) -> Self
fn from(data_message: LinkMessage) -> Self
source§impl Ord for LinkMessage
impl Ord for LinkMessage
source§impl PartialEq for LinkMessage
impl PartialEq for LinkMessage
source§impl PartialOrd for LinkMessage
impl PartialOrd for LinkMessage
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for LinkMessage
impl Serialize for LinkMessage
impl Eq for LinkMessage
Auto Trait Implementations§
impl Freeze for LinkMessage
impl !RefUnwindSafe for LinkMessage
impl Send for LinkMessage
impl Sync for LinkMessage
impl Unpin for LinkMessage
impl !UnwindSafe for LinkMessage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.