pub trait DirEntryWriter {
// Required methods
fn dir_entry(
&mut self,
name: impl AsRef<LxStr>,
inode_nr: u64,
offset: u64,
file_type: u32,
) -> bool;
fn dir_entry_plus(
&mut self,
name: impl AsRef<LxStr>,
offset: u64,
entry: fuse_entry_out,
) -> bool;
fn check_dir_entry_plus(&self, name: impl AsRef<LxStr>) -> bool;
}
Expand description
Helpers for writing a reply for read_dir
or read_dir_plus
.
This trait is implemented on Cursor<&mut Vec<u8>>
. To write directory entries, create an
appropriately-sized vector with Vec::with_capacity
, wrap it in a Cursor
, and write entries
using the methods of this trait.
The methods of this trait ensure that the entries are correctly aligned in the buffer.
Required Methods§
Sourcefn dir_entry(
&mut self,
name: impl AsRef<LxStr>,
inode_nr: u64,
offset: u64,
file_type: u32,
) -> bool
fn dir_entry( &mut self, name: impl AsRef<LxStr>, inode_nr: u64, offset: u64, file_type: u32, ) -> bool
Write a directory entry to the buffer.
Returns true
if the entry fit in the buffer; otherwise, false.
Sourcefn dir_entry_plus(
&mut self,
name: impl AsRef<LxStr>,
offset: u64,
entry: fuse_entry_out,
) -> bool
fn dir_entry_plus( &mut self, name: impl AsRef<LxStr>, offset: u64, entry: fuse_entry_out, ) -> bool
Write a directory entry for read_dir_plus
to the buffer.
Returns true
if the entry fit in the buffer; otherwise, false.
Sourcefn check_dir_entry_plus(&self, name: impl AsRef<LxStr>) -> bool
fn check_dir_entry_plus(&self, name: impl AsRef<LxStr>) -> bool
Checks whether an entry for read_dir_plus
will fit in the buffer without writing it.
Returns true
if the entry fit in the buffer; otherwise, false.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.