pub fn resolve<'needle>(
    block: &[u8],
    needle: &'needle str,
    cache: &mut Option<Cache>
) -> Result<MaybeResolved<'needle>, ResolveError>
Expand description

Resolves a single path segment on dag-pb or UnixFS directories (normal, sharded).

The third parameter can always be substituted with a None but when repeatedly resolving over multiple path segments, it can be used to cache the work queue used to avoid re-allocating it between the steps.

Returns on success either a walker which can be used to traverse additional links searching for the link, or the resolved link once it has been found or NotFound when it cannot be found.

Note

The returned walker by default borrows the needle but it can be transformed into owned walker with ShardedLookup::with_owned_needle which will allow moving it between tasks and boundaries.