[][src]Struct fuse::protocol::readdir::ReaddirResponse

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

Response type for FuseHandlers::readdir.

Implementations

impl<'_> ReaddirResponse<'_>[src]

pub const EMPTY: &'static ReaddirResponse<'static>[src]

An empty ReaddirResponse that cannot have entries added to it.

This is useful for returning end-of-stream responses.

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

pub fn with_max_size(max_size: u32) -> ReaddirResponse<'a>[src]

This is supported on feature="std" only.

Constructs a new, empty ReaddirResponse that will grow up to the given maximum size.

Examples

fn readdir(
	request: &fuse::ReaddirRequest,
	respond: impl for<'a> fuse::Respond<fuse::ReaddirResponse<'a>>,
) {
	let mut response = fuse::ReaddirResponse::with_max_size(request.size());
	/* fill in response */
	respond.ok(&response);
}

pub fn with_capacity(capacity: &'a mut [u8]) -> ReaddirResponse<'a>[src]

Constructs a new, empty ReaddirResponse that will use the given buffer as capacity. The caller is responsible for allocating a buffer of the appropriate size and alignment.

Panics

Panics if buf is not sufficiently aligned. The minimum alignment is align_of::<u64>().

Examples

fn readdir(
	request: &fuse::ReaddirRequest,
	respond: impl for<'a> fuse::Respond<fuse::ReaddirResponse<'a>>,
) {
	let mut buf = new_aligned_buf(request.size());
	let mut response = fuse::ReaddirResponse::with_capacity(&mut buf);
	/* fill in response */
	respond.ok(&response);
}

pub fn entries(&self) -> impl Iterator<Item = &ReaddirEntry>[src]

pub fn add_entry(
    &mut self,
    node_id: NodeId,
    name: &NodeName,
    cursor: NonZeroU64
) -> &mut ReaddirEntry
[src]

pub fn try_add_entry(
    &mut self,
    node_id: NodeId,
    name: &NodeName,
    cursor: NonZeroU64
) -> Result<&mut ReaddirEntry, ReaddirError>
[src]

Trait Implementations

impl<'_> Debug for ReaddirResponse<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ReaddirResponse<'a>

impl<'a> Send for ReaddirResponse<'a>

impl<'a> Sync for ReaddirResponse<'a>

impl<'a> Unpin for ReaddirResponse<'a>

impl<'a> !UnwindSafe for ReaddirResponse<'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, 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.