[][src]Struct ipfs_unixfs::walk::FileSegment

pub struct FileSegment<'a> { /* fields omitted */ }

A slice of bytes of a possibly multi-block file. The slice can be accessed via as_bytes() or AsRef<[u8]>::as_ref().

Implementations

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

pub fn is_first(&self) -> bool[src]

Returns true if this is the first block in the file, false otherwise.

Note: the first block can also be the last one.

pub fn is_last(&self) -> bool[src]

Returns true if this is the last block in the file, false otherwise.

Note: the last block can also be the first one.

pub fn as_bytes(&self) -> &'a [u8][src]

Returns a slice into the file's bytes, which can be empty, as is the case for any intermediate blocks which only contain links to further blocks.

Trait Implementations

impl<'_> AsRef<[u8]> for FileSegment<'_>[src]

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for FileSegment<'a>

impl<'a> Send for FileSegment<'a>

impl<'a> Sync for FileSegment<'a>

impl<'a> Unpin for FileSegment<'a>

impl<'a> UnwindSafe for FileSegment<'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.