Skip to content

Commit

Permalink
Align Rust with Reliability exported in zenoh::qos (#335)
Browse files Browse the repository at this point in the history
* Align Rust with Reliability exported in zenoh::qos

* Align with Zenoh
  • Loading branch information
Mallets authored Sep 19, 2024
1 parent 89308fc commit f3d8983
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 58 deletions.
82 changes: 41 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ pub(crate) mod zenoh {
config::{Config, WhatAmI, WhatAmIMatcher, ZenohId},
handlers::Handler,
key_expr::{KeyExpr, SetIntersectionLevel},
pubsub::{Publisher, Reliability, Subscriber},
qos::{CongestionControl, Priority},
pubsub::{Publisher, Subscriber},
qos::{CongestionControl, Priority, Reliability},
query::{
ConsolidationMode, Parameters, Query, QueryConsolidation, QueryTarget, Queryable,
Reply, ReplyError, Selector,
Expand Down
15 changes: 2 additions & 13 deletions src/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use crate::{
bytes::{Encoding, ZBytes},
handlers::HandlerImpl,
key_expr::KeyExpr,
macros::{build, enum_mapper, option_wrapper},
qos::{CongestionControl, Priority},
macros::{build, option_wrapper},
qos::{CongestionControl, Priority, Reliability},
sample::Sample,
utils::{generic, wait},
};
Expand Down Expand Up @@ -101,17 +101,6 @@ impl Publisher {
}
}

enum_mapper!(zenoh::pubsub::Reliability: u8 {
BestEffort,
Reliable
});

#[pymethods]
impl Reliability {
#[classattr]
const DEFAULT: Self = Self::BestEffort;
}

option_wrapper!(
zenoh::pubsub::Subscriber<HandlerImpl<Sample>>,
"Undeclared subscriber"
Expand Down
11 changes: 11 additions & 0 deletions src/qos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,14 @@ impl CongestionControl {
#[classattr]
const DEFAULT: Self = Self::Drop;
}

enum_mapper!(zenoh::qos::Reliability: u8 {
BestEffort,
Reliable
});

#[pymethods]
impl Reliability {
#[classattr]
const DEFAULT: Self = Self::BestEffort;
}
4 changes: 2 additions & 2 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use crate::{
handlers::{into_handler, HandlerImpl},
key_expr::KeyExpr,
macros::{build, with, wrapper},
pubsub::{Publisher, Reliability, Subscriber},
qos::{CongestionControl, Priority},
pubsub::{Publisher, Subscriber},
qos::{CongestionControl, Priority, Reliability},
query::{QueryConsolidation, QueryTarget, Queryable, Reply, Selector},
time::Timestamp,
utils::{wait, IntoPython, MapInto},
Expand Down

0 comments on commit f3d8983

Please sign in to comment.