Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 2ba7090

Browse files
committed
doc: add missing public method docs for IpfsPath
1 parent fbaebc5 commit 2ba7090

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/path.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ impl FromStr for IpfsPath {
7575
}
7676

7777
impl IpfsPath {
78+
/// Creates a new [`IpfsPath`] from a [`PathRoot`].
7879
pub fn new(root: PathRoot) -> Self {
7980
IpfsPath {
8081
root,
8182
path: Default::default(),
8283
}
8384
}
8485

86+
/// Returns the [`PathRoot`] "protocol" configured for the [`IpfsPath`].
8587
pub fn root(&self) -> &PathRoot {
8688
&self.root
8789
}
@@ -99,7 +101,7 @@ impl IpfsPath {
99101
Ok(path)
100102
}
101103

102-
/// Returns an iterator over the path segments following the root
104+
/// Returns an iterator over the path segments following the root.
103105
pub fn iter(&self) -> impl Iterator<Item = &str> {
104106
self.path.iter().map(|s| s.as_str())
105107
}
@@ -259,6 +261,7 @@ impl fmt::Debug for PathRoot {
259261
}
260262

261263
impl PathRoot {
264+
/// Returns the `Some(Cid)` if the [`Cid`] based path is present or `None`.
262265
pub fn cid(&self) -> Option<&Cid> {
263266
match self {
264267
PathRoot::Ipld(cid) => Some(cid),

0 commit comments

Comments
 (0)