Skip to content

Commit

Permalink
rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Jul 21, 2020
1 parent 773f0f8 commit cd51a02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions zenoh-protocol/src/proto/msg.rs
Expand Up @@ -197,6 +197,18 @@ pub mod zmsg {
pub fn has_flag(byte: u8, flag: u8) -> bool { byte & flag != 0 }
}

/// Some informations about the associated data.
///
/// # Examples
/// ```
/// # use zenoh_protocol::io::RBuf;
/// # use zenoh_protocol::proto::DataInfo;
/// # struct FakeSample { data_info: Option<RBuf> }
/// # let sample = FakeSample { data_info: None };
/// if let Some(mut info) = sample.data_info {
/// let info: DataInfo = info.read_datainfo().unwrap();
/// }
/// ```
#[derive(Debug, Clone)]
pub struct DataInfo {
pub source_id: Option<PeerId>,
Expand Down
9 changes: 9 additions & 0 deletions zenoh-router/src/runtime/mod.rs
Expand Up @@ -97,6 +97,15 @@ impl Runtime {
}
}

/// Struct to pass to [open](../../zenoh/net/fn.open.html) to configure the zenoh-net [Session](../../zenoh/net/struct.Session.html).
///
/// # Examples
/// ```
/// # use zenoh_router::runtime::Config;
/// let config = Config::peer()
/// .add_listener("tcp/0.0.0.0:7447")
/// .add_peer("tcp/10.10.10.10:7447");
/// ```
#[derive(Debug, Clone, PartialEq)]
pub struct Config {
pub whatami: WhatAmI,
Expand Down

0 comments on commit cd51a02

Please sign in to comment.