pub enum LinkMessage {
Data(DataMessage),
Watermark(Timestamp),
}Expand description
The Zenoh-Flow message that is sent across Link and across Zenoh.
It contains either a DataMessage or a Timestamp,
in such case the LinkMessage variant is Watermark.
Variants§
Data(DataMessage)
Watermark(Timestamp)
Implementations§
Source§impl LinkMessage
impl LinkMessage
Sourcepub fn from_payload(output: Payload, timestamp: Timestamp) -> Self
pub fn from_payload(output: Payload, timestamp: Timestamp) -> Self
Creates a LinkMessage::Data from a Payload.
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<()>
Serializes the LinkMessage using bincode into the given buffer.
The inner_buffer is used to serialize (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 stabilizes no (re)allocation is performed.
§Errors
An error variant is returned in case of:
- fails to serialize
Sourcepub fn serialize_bincode_into_shm(
&self,
shm_buffer: &mut [u8],
payload_buffer: &mut Vec<u8>,
) -> Result<()>
pub fn serialize_bincode_into_shm( &self, shm_buffer: &mut [u8], payload_buffer: &mut Vec<u8>, ) -> Result<()>
Serializes the LinkMessage using bincode into the given shm_buffer shared memory
buffer.
The inner_buffer is used to serialize (if need be) the Payload contained inside the
LinkMessage.
§Performance
The provided inner_buffer is reused and cleared between calls, so once its capacity
stabilizes no (re)allocation is performed.
§Errors
An error variant is returned in case of:
- fails to serialize
- there is not enough space in the slice
Sourcepub fn get_timestamp(&self) -> Timestamp
pub fn get_timestamp(&self) -> Timestamp
Returns the Timestamp associated with the message.
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<'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 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
Source§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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more