Skip to content

Commit

Permalink
zenoh-id support made stable
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Oct 15, 2024
1 parent 3727cc1 commit 34d864d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
6 changes: 2 additions & 4 deletions build-resources/opaque-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ use zenoh::{
query::{Query, Queryable, Reply, ReplyError},
sample::Sample,
scouting::Hello,
session::Session,
session::{Session, ZenohId},
time::Timestamp,
};
#[cfg(feature = "unstable")]
use zenoh::{
liveliness::LivelinessToken,
pubsub::MatchingListener,
sample::SourceInfo,
session::{EntityGlobalId, ZenohId},
session::EntityGlobalId
};
#[cfg(all(feature = "shared-memory", feature = "unstable"))]
use zenoh::{
Expand Down Expand Up @@ -190,8 +190,6 @@ get_opaque_type_data!(Option<Config>, z_owned_config_t);
/// A loaned Zenoh configuration.
get_opaque_type_data!(Config, z_loaned_config_t);

#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief A Zenoh ID.
///
/// In general, valid Zenoh IDs are LSB-first 128bit unsigned and non-zero integers.
Expand Down
2 changes: 0 additions & 2 deletions src/closures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ mod query_closure;
pub use reply_closure::*;
mod reply_closure;

#[cfg(feature = "unstable")]
pub use zenohid_closure::*;
#[cfg(feature = "unstable")]
mod zenohid_closure;

pub use response_channel::*;
Expand Down
4 changes: 0 additions & 4 deletions src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ impl From<[u8; 16]> for z_id_t {
}
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Formats the `z_id_t` into 16-digit hex string (LSB-first order)
#[no_mangle]
pub extern "C" fn z_id_to_string(zid: &z_id_t, dst: &mut MaybeUninit<z_owned_string_t>) {
let zid = zid.as_rust_type_ref();
dst.as_rust_type_mut_uninit().write(zid.to_string().into());
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Returns the session's Zenoh ID.
///
/// Unless the `session` is invalid, that ID is guaranteed to be non-zero.
Expand All @@ -51,7 +49,6 @@ pub unsafe extern "C" fn z_info_zid(session: &z_loaned_session_t) -> z_id_t {
session.info().zid().wait().into_c_type()
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Fetches the Zenoh IDs of all connected peers.
///
/// `callback` will be called once for each ID, is guaranteed to never be called concurrently,
Expand All @@ -72,7 +69,6 @@ pub unsafe extern "C" fn z_info_peers_zid(
result::Z_OK
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Fetches the Zenoh IDs of all connected routers.
///
/// `callback` will be called once for each ID, is guaranteed to never be called concurrently,
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ mod zbytes;
pub use crate::zbytes::*;
mod keyexpr;
pub use crate::keyexpr::*;
#[cfg(feature = "unstable")]
mod info;
#[cfg(feature = "unstable")]
pub use crate::info::*;
mod get;
pub use crate::get::*;
Expand Down

0 comments on commit 34d864d

Please sign in to comment.