Struct zenoh_flow_nodes::prelude::InputRaw
source · pub struct InputRaw { /* private fields */ }Expand description
An InputRaw receives “raw” LinkMessage.
As opposed to a typed Input<T>, an InputRaw will not perform any operation on the data it receives.
This behaviour is useful when access to the underlying data is either irrelevant (e.g. for rate-limiting purposes)
or when Zenoh-Flow should not attempt to interpret the contained Payload (e.g. for
bindings).
Implementations§
source§impl InputRaw
impl InputRaw
pub fn port_id(&self) -> &PortId
sourcepub fn channels_count(&self) -> usize
pub fn channels_count(&self) -> usize
Returns the number of channels associated with this Input.
sourcepub fn try_recv(&self) -> Result<Option<LinkMessage>>
pub fn try_recv(&self) -> Result<Option<LinkMessage>>
Returns the first queued LinkMessage or None if there is no queued message.
§Asynchronous alternative: recv
This method is a synchronous fail-fast alternative to it’s asynchronous counterpart: recv. Although
synchronous, this method will not block the thread on which it is executed.
§Errors
An error is returned if the associated channel is disconnected.
sourcepub async fn recv(&self) -> Result<LinkMessage>
pub async fn recv(&self) -> Result<LinkMessage>
Returns the first LinkMessage that was received, asynchronously, on any of the channels associated with this Input.
If several LinkMessage are received at the same time, one is randomly selected.
§Errors
An error is returned if a channel was disconnected.