diff --git a/zenoh/src/api/sample.rs b/zenoh/src/api/sample.rs index b3559012d6..1bfddab18a 100644 --- a/zenoh/src/api/sample.rs +++ b/zenoh/src/api/sample.rs @@ -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, source_sn: Option) -> 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> {