Struct zenoh_protocol::proto::ZenohMessage
source · pub struct ZenohMessage {
pub body: ZenohBody,
pub channel: Channel,
pub routing_context: Option<RoutingContext>,
pub attachment: Option<Attachment>,
}Fields§
§body: ZenohBody§channel: Channel§routing_context: Option<RoutingContext>§attachment: Option<Attachment>Implementations§
source§impl ZenohMessage
impl ZenohMessage
pub fn make_declare(
declarations: Vec<Declaration>,
routing_context: Option<RoutingContext>,
attachment: Option<Attachment>
) -> ZenohMessage
pub fn make_data(
key: WireExpr<'static>,
payload: ZBuf,
channel: Channel,
congestion_control: CongestionControl,
data_info: Option<DataInfo>,
routing_context: Option<RoutingContext>,
reply_context: Option<ReplyContext>,
attachment: Option<Attachment>
) -> ZenohMessage
pub fn make_unit(
channel: Channel,
congestion_control: CongestionControl,
reply_context: Option<ReplyContext>,
attachment: Option<Attachment>
) -> ZenohMessage
pub fn make_pull(
is_final: bool,
key: WireExpr<'static>,
pull_id: ZInt,
max_samples: Option<ZInt>,
attachment: Option<Attachment>
) -> ZenohMessage
pub fn make_query(
key: WireExpr<'static>,
parameters: String,
qid: ZInt,
target: Option<QueryTarget>,
consolidation: ConsolidationMode,
body: Option<QueryBody>,
routing_context: Option<RoutingContext>,
attachment: Option<Attachment>
) -> ZenohMessage
pub fn make_link_state_list(
link_states: Vec<LinkState>,
attachment: Option<Attachment>
) -> ZenohMessage
sourcepub fn is_reliable(&self) -> bool
pub fn is_reliable(&self) -> bool
Examples found in repository?
src/proto/msg.rs (line 1267)
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281
pub fn is_droppable(&self) -> bool {
if !self.is_reliable() {
return true;
}
let cc = match &self.body {
ZenohBody::Data(data) => data.congestion_control,
ZenohBody::Unit(unit) => unit.congestion_control,
ZenohBody::Declare(_) => zmsg::default_congestion_control::DECLARE,
ZenohBody::Pull(_) => zmsg::default_congestion_control::PULL,
ZenohBody::Query(_) => zmsg::default_congestion_control::QUERY,
ZenohBody::LinkStateList(_) => zmsg::default_congestion_control::LINK_STATE_LIST,
};
cc == CongestionControl::Drop
}pub fn is_droppable(&self) -> bool
Trait Implementations§
source§impl Clone for ZenohMessage
impl Clone for ZenohMessage
source§fn clone(&self) -> ZenohMessage
fn clone(&self) -> ZenohMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ZenohMessage
impl Debug for ZenohMessage
source§impl Display for ZenohMessage
impl Display for ZenohMessage
source§impl PartialEq<ZenohMessage> for ZenohMessage
impl PartialEq<ZenohMessage> for ZenohMessage
source§fn eq(&self, other: &ZenohMessage) -> bool
fn eq(&self, other: &ZenohMessage) -> bool
This method tests for
self and other values to be equal, and is used
by ==.