Skip to main content

ReplyCreate

Struct ReplyCreate 

Source
pub struct ReplyCreate { /* private fields */ }
Expand description

Create reply

Implementations§

Source§

impl ReplyCreate

Source

pub fn created( self, ttl: &Duration, attr: &FileAttr, generation: Generation, fh: FileHandle, flags: FopenFlags, )

Reply to a request with a newly created file entry and its newly open file handle

§Panics

When attempting to use kernel passthrough. Use opened_passthrough() instead.

Source

pub fn error(self, err: Errno)

Reply to a request with the given error code

Source

pub fn open_backing(&self, fd: impl AsFd) -> Result<BackingId>

Registers a fd for passthrough, returning a BackingId. Once you have the backing ID, you can pass it as the 6th parameter of ReplyCreate::created_passthrough(). This is done in two separate steps because you must reuse backing IDs for the same inode for all open file handles.

Source

pub unsafe fn wrap_backing(&self, id: u32) -> BackingId

Wraps a raw FUSE backing_id value, returning a BackingId. Once you have the backing ID, you can pass it as the 3rd parameter of ReplyCreate::created_passthrough(). This is done in two separate steps because you must reuse backing IDs for the same inode for all open file handles.

This function takes ownership of the given backing ID value, automatically closing it once the returned BackingId is dropped. You may reobtain ownership of the backing ID by calling BackingId::into_raw().

§Safety

The given ID must be open and belong to this FUSE session, and may not be closed while the returned BackingId instance is still live.

Source

pub fn created_passthrough( self, ttl: &Duration, attr: &FileAttr, generation: Generation, fh: FileHandle, flags: FopenFlags, backing_id: &BackingId, )

Reply to a request with an opened backing id. Call ReplyCreate::open_backing() to get one of these.

Note that you must reuse the given BackingId for all future ReplyOpen::opened_passthrough() invocations as long as the passed file handle stays open!

Trait Implementations§

Source§

impl Debug for ReplyCreate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.