Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Rust with Reliability exported in zenoh::qos #335

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading