Skip to content

Commit

Permalink
Declare message can be Push/Request/RequestContinuous/Response 3 (#908)
Browse files Browse the repository at this point in the history
* Declare message can be Push/Request/RequestContinuous/Response

* Address review comments

* Remove F: Future flag from DeclareInterest

* cargo fmt --all

* Remove unused Interest flags field

* Update doc

* Remove unneeded interest_id field

* Update commons/zenoh-protocol/src/network/declare.rs

* Remove unused UndeclareInterest

---------

Co-authored-by: Luca Cominardi <[email protected]>
  • Loading branch information
OlivierHecart and Mallets authored Apr 5, 2024
1 parent 71a9423 commit 5ee2bdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
34 changes: 0 additions & 34 deletions commons/zenoh-protocol/src/network/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,38 +1029,4 @@ pub mod interest {
Self { options }
}
}

/// ```text
/// Flags:
/// - X: Reserved
/// - X: Reserved
/// - Z: Extension If Z==1 then at least one extension is present
///
/// 7 6 5 4 3 2 1 0
/// +-+-+-+-+-+-+-+-+
/// |Z|X|X| U_INT |
/// +---------------+
/// ~ intst_id:z32 ~
/// +---------------+
/// ~ [decl_exts] ~ if Z==1
/// +---------------+
/// ```
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct UndeclareInterest {
pub id: InterestId,
pub ext_wire_expr: common::ext::WireExprType,
}

impl UndeclareInterest {
#[cfg(feature = "test")]
pub fn rand() -> Self {
use rand::Rng;
let mut rng = rand::thread_rng();

let id: InterestId = rng.gen();
let ext_wire_expr = common::ext::WireExprType::rand();

Self { id, ext_wire_expr }
}
}
}
4 changes: 2 additions & 2 deletions commons/zenoh-protocol/src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use core::fmt;

pub use declare::{
Declare, DeclareBody, DeclareFinal, DeclareInterest, DeclareKeyExpr, DeclareMode,
DeclareQueryable, DeclareSubscriber, DeclareToken, UndeclareInterest, UndeclareKeyExpr,
UndeclareQueryable, UndeclareSubscriber, UndeclareToken,
DeclareQueryable, DeclareSubscriber, DeclareToken, UndeclareKeyExpr, UndeclareQueryable,
UndeclareSubscriber, UndeclareToken,
};
pub use oam::Oam;
pub use push::Push;
Expand Down

0 comments on commit 5ee2bdb

Please sign in to comment.