[][src]Enum ipfs_unixfs::walk::Entry

pub enum Entry<'a> {
    RootDirectory(&'a Cid, &'a Path, &'a Metadata),
    Bucket(&'a Cid, &'a Path),
    Directory(&'a Cid, &'a Path, &'a Metadata),
    File(&'a Cid, &'a Path, &'a Metadatau64),
    Symlink(&'a Cid, &'a Path, &'a Metadata),
}

Representation of the current item of Walker or the last observed item.

Variants

RootDirectory(&'a Cid, &'a Path, &'a Metadata)

Current item is the root directory (HAMTShard or plain Directory).

Bucket(&'a Cid, &'a Path)

Current item is a continuation of a HAMTShard directory. Only the root HAMTShard will have file metadata.

Directory(&'a Cid, &'a Path, &'a Metadata)

Current item is a non-root plain Directory or a HAMTShard directory.

File(&'a Cid, &'a Path, &'a Metadatau64)

Current item is possibly a root file with a path, metadata, and a total file size.

Current item is possibly a root symlink.

Implementations

impl<'a> Entry<'a>[src]

pub fn path(&self) -> &'a Path[src]

Returns the path for the latest entry. This is created from a UTF-8 string and, as such, is always representable on all supported platforms.

pub fn metadata(&self) -> Option<&'a Metadata>[src]

Returns the metadata for the latest entry. It exists for initial directory entries, files, and symlinks but not for continued HamtShards.

pub fn total_file_size(&self) -> Option<u64>[src]

Returns the total size of the file this entry represents, or None if not a file.

pub fn cid(&self) -> &Cid[src]

Returns the Cid for the latest entry.

Trait Implementations

impl<'a> Debug for Entry<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Entry<'a>

impl<'a> Send for Entry<'a>

impl<'a> Sync for Entry<'a>

impl<'a> Unpin for Entry<'a>

impl<'a> UnwindSafe for Entry<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.