Struct rust_unixfs::file::visit::IdleFileVisit
source · 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