[−][src]Struct ipfs_unixfs::walk::Walker
Walker
helps with walking a UnixFS tree, including all of the content and files. It is created with
Walker::new
and walked over each block with Walker::continue_block
. Use
Walker::pending_links
to obtain the next Cid
to be loaded and the prefetchable links.
Implementations
impl Walker
[src]
pub fn new(cid: Cid, root_name: String) -> Walker
[src]
Returns a new instance of a walker, ready to start from the given Cid
.
pub fn as_entry(&self) -> Option<Entry>
[src]
Returns a description of the kind of node the Walker
is currently looking at, if
continue_walk
has been called after the value was created.
pub fn pending_links<'a>(
&'a self
) -> (&'a Cid, impl Iterator<Item = &'a Cid> + 'a)
[src]
&'a self
) -> (&'a Cid, impl Iterator<Item = &'a Cid> + 'a)
Returns the next Cid
to load and pass its associated content to continue_walk
.
pub fn continue_walk<'a>(
self,
bytes: &'a [u8],
cache: &mut Option<Cache>
) -> Result<ContinuedWalk<'a>, Error>
[src]
self,
bytes: &'a [u8],
cache: &mut Option<Cache>
) -> Result<ContinuedWalk<'a>, Error>
Continues the walk.
Returns a descriptor for the next element found as ContinuedWalk
which includes the means
to further continue the walk. bytes
is the raw data of the next block, cache
is an
optional cache for data structures which can always be substituted with &mut None
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Walker
impl Send for Walker
impl Sync for Walker
impl Unpin for Walker
impl UnwindSafe for Walker
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,