pub struct IdleFileVisit { /* private fields */ }
Expand description
IdleFileVisit represents a prepared file visit over a tree. The user has to know the CID and be able to get the block for the visit.
Note: For easier to use interface, you should consider using ipfs_unixfs::walk::Walker
.
It uses IdleFileVisit
and FileVisit
internally but has a better API.
Implementations§
Source§impl IdleFileVisit
impl IdleFileVisit
Sourcepub fn with_target_range(self, range: Range<u64>) -> Self
pub fn with_target_range(self, range: Range<u64>) -> Self
Target range represents the target byte range of the file we are interested in visiting.
Sourcepub fn start(
self,
block: &[u8],
) -> Result<(&'_ [u8], u64, Metadata, Option<FileVisit>), FileReadFailed>
pub fn start( self, block: &[u8], ) -> Result<(&'_ [u8], u64, Metadata, Option<FileVisit>), FileReadFailed>
Begins the visitation by processing the first block to be visited.
Returns (on success) a tuple of file bytes, total file size, any metadata associated, and
optionally a FileVisit
to continue the walk.
Trait Implementations§
Source§impl Debug for IdleFileVisit
impl Debug for IdleFileVisit
Source§impl Default for IdleFileVisit
impl Default for IdleFileVisit
Source§fn default() -> IdleFileVisit
fn default() -> IdleFileVisit
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IdleFileVisit
impl RefUnwindSafe for IdleFileVisit
impl Send for IdleFileVisit
impl Sync for IdleFileVisit
impl Unpin for IdleFileVisit
impl UnwindSafe for IdleFileVisit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more