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

ipfs-unixfs: Walker support for skipping or detaching subtrees #213

Open
@koivunej

Description

@koivunej

The current unixfs/examples/get.rs is actually an example of ipfs ls but with different formatting. It would be "compatible" with ipfs ls if ipfs_unixfs::walk::Walker (re-exported as ipfs::unixfs::ll::walk::Walker) would support subtree skipping. Skipping was thought of but turned out it was out of scope for /get in #189. Skipping in turn could be used as a form of "detaching the next work items" suitable to be put in a work queue shared by multiple workers at the expense of cloning the accumulated paths for each work item.

For ipfs ls compatibility in the example skipping would always happen deeper than the root directory block(s) (multiple in case of HAMT sharded directory). To skip files it would mean replacing the Option<FileVisit> inside InnerEntry of InnerKind::File with None, or returning a new Walker value just for that file. For skipping directories It would mean popping elements for any larger depth than the current depth, or returning them as a single or multiple Walker values. Symlinks are single blocks so skipping should not do anything on them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedunixfsIssue related to `ipfs-unixfs` under `unixfs/`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions