Struct Walker

Source
pub struct Walker { /* private fields */ }
Expand description

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§

Source§

impl Walker

Source

pub fn new(cid: Cid, root_name: String) -> Walker

Returns a new instance of a walker, ready to start from the given Cid.

Returns the next Cid to load and pass its associated content to continue_walk.

Source

pub fn next<'a: 'c, 'b: 'c, 'c>( &'a mut self, bytes: &'b [u8], cache: &mut Option<Cache>, ) -> Result<ContinuedWalk<'c>, 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.

Source

pub fn should_continue(&self) -> bool

true if the walk of inspect should continue

Trait Implementations§

Source§

impl Debug for Walker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Walker

§

impl RefUnwindSafe for Walker

§

impl Send for Walker

§

impl Sync for Walker

§

impl Unpin for Walker

§

impl UnwindSafe for Walker

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.