Skip to content

Commit

Permalink
Merge pull request #1446 from eclipse-zenoh/dev/sourceinfo
Browse files Browse the repository at this point in the history
Add new builder for SourceInfo
  • Loading branch information
yellowhatter authored Sep 18, 2024
2 parents f2c3516 + a98f8c5 commit 1b046d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zenoh/src/api/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ pub struct SourceInfo {

#[zenoh_macros::unstable]
impl SourceInfo {
#[zenoh_macros::unstable]
/// Build a new [`SourceInfo`].
pub fn new(source_id: Option<EntityGlobalId>, source_sn: Option<SourceSn>) -> Self {
Self {
source_id,
source_sn,
}
}

#[zenoh_macros::unstable]
/// The [`EntityGlobalId`] of the zenoh entity that published the concerned [`Sample`].
pub fn source_id(&self) -> Option<&EntityGlobalId> {
Expand Down

0 comments on commit 1b046d4

Please sign in to comment.