[−][src]Function ipfs::refs::iplds_refs
pub fn iplds_refs<'a, Types, MaybeOwned, Iter>(
ipfs: MaybeOwned,
iplds: Iter,
max_depth: Option<u64>,
unique: bool
) -> impl Stream<Item = Result<Edge, BlockError>> + Send + 'a where
Types: IpfsTypes,
MaybeOwned: Borrow<Ipfs<Types>> + Send + 'a,
Iter: IntoIterator<Item = (Cid, Ipld)> + Send + 'a,
Gather links as edges between two documents from all of the iplds
which represent the
document and it's original Cid
, as the Ipld
can be a subtree of the document.
This stream does not stop on error.
Differences from other implementations
js-ipfs
does seem to do a recursive descent on all links. Looking at the tests it would
appear that go-ipfs
implements this in similar fashion. This implementation is breadth-first
to be simpler at least.
Related: https://github.com/ipfs/js-ipfs/pull/2982
Lifetime of returned stream
Depending on how this function is called, the lifetime will be tied to the lifetime of given
&Ipfs
or 'static
when given ownership of Ipfs
.