pub struct ReplyCreate { /* private fields */ }Expand description
Create reply
Implementations§
Source§impl ReplyCreate
impl ReplyCreate
Sourcepub fn created(
self,
ttl: &Duration,
attr: &FileAttr,
generation: Generation,
fh: FileHandle,
flags: FopenFlags,
)
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.
Sourcepub fn open_backing(&self, fd: impl AsFd) -> Result<BackingId>
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.
Sourcepub unsafe fn wrap_backing(&self, id: u32) -> BackingId
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.
Sourcepub fn created_passthrough(
self,
ttl: &Duration,
attr: &FileAttr,
generation: Generation,
fh: FileHandle,
flags: FopenFlags,
backing_id: &BackingId,
)
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!