[][src]Trait polyfuse::bytes::Bytes

pub trait Bytes {
    pub fn size(&self) -> usize;
pub fn count(&self) -> usize;
pub fn fill_bytes<'a>(&'a self, dst: &mut dyn FillBytes<'a>); }

A trait that represents a collection of bytes.

The role of this trait is similar to Buf provided by bytes crate, but it focuses on the situation where all byte chunks are written in a single operation. This difference is due to the requirement of FUSE kernel driver that all data in a reply message must be passed in a single write(2) syscall.

Required methods

pub fn size(&self) -> usize[src]

Return the total amount of bytes contained in this data.

pub fn count(&self) -> usize[src]

Return the number of byte chunks.

pub fn fill_bytes<'a>(&'a self, dst: &mut dyn FillBytes<'a>)[src]

Fill with potentially multiple slices in this data.

This method corresonds to Buf::bytes_vectored, except that the number of byte chunks is acquired from Bytes::count and the implementation needs to add all chunks in dst.

Loading content...

Implementations on Foreign Types

impl<R: ?Sized, '_> Bytes for &'_ R where
    R: Bytes
[src]

impl<R: ?Sized, '_> Bytes for &'_ mut R where
    R: Bytes
[src]

impl<R: ?Sized> Bytes for Box<R> where
    R: Bytes
[src]

impl<R: ?Sized> Bytes for Rc<R> where
    R: Bytes
[src]

impl<R: ?Sized> Bytes for Arc<R> where
    R: Bytes
[src]

impl Bytes for ()[src]

impl Bytes for [u8; 0][src]

impl<T1> Bytes for (T1,) where
    T1: Bytes
[src]

impl<T1, T2> Bytes for (T1, T2) where
    T1: Bytes,
    T2: Bytes
[src]

impl<T1, T2, T3> Bytes for (T1, T2, T3) where
    T1: Bytes,
    T2: Bytes,
    T3: Bytes
[src]

impl<T1, T2, T3, T4> Bytes for (T1, T2, T3, T4) where
    T1: Bytes,
    T2: Bytes,
    T3: Bytes,
    T4: Bytes
[src]

impl<T1, T2, T3, T4, T5> Bytes for (T1, T2, T3, T4, T5) where
    T1: Bytes,
    T2: Bytes,
    T3: Bytes,
    T4: Bytes,
    T5: Bytes
[src]

impl<R> Bytes for [R] where
    R: Bytes
[src]

impl<R> Bytes for Vec<R> where
    R: Bytes
[src]

impl<T> Bytes for Option<T> where
    T: Bytes
[src]

impl<L, R> Bytes for Either<L, R> where
    L: Bytes,
    R: Bytes
[src]

impl Bytes for [u8][src]

impl Bytes for str[src]

impl Bytes for String[src]

impl Bytes for Vec<u8>[src]

impl<'_> Bytes for Cow<'_, [u8]>[src]

impl Bytes for OsStr[src]

impl Bytes for OsString[src]

Loading content...

Implementors

impl Bytes for AttrOut[src]

impl Bytes for BmapOut[src]

impl Bytes for EntryOut[src]

impl Bytes for LkOut[src]

impl Bytes for OpenOut[src]

impl Bytes for PollOut[src]

impl Bytes for ReaddirOut[src]

impl Bytes for StatfsOut[src]

impl Bytes for WriteOut[src]

impl Bytes for XattrOut[src]

Loading content...