pub struct MemFs { /* private fields */ }Expand description
In-memory filesystem implementation used by tests and examples.
Implementations§
Trait Implementations§
Source§impl CommitSupport<u64> for MemFs
impl CommitSupport<u64> for MemFs
Source§fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
_offset: u64,
_count: u32,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
_offset: u64,
_count: u32,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Flush buffered writes for a byte range.
Source§impl FileSystem for MemFs
impl FileSystem for MemFs
Source§fn capabilities(&self) -> FsCapabilities
fn capabilities(&self) -> FsCapabilities
Returns static capability flags.
Source§fn statfs<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = FsResult<FsStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn statfs<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
) -> Pin<Box<dyn Future<Output = FsResult<FsStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns filesystem-wide space and object statistics.
Source§fn getattr<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
) -> Pin<Box<dyn Future<Output = FsResult<Attrs>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn getattr<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
) -> Pin<Box<dyn Future<Output = FsResult<Attrs>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns complete exported attributes for an object.
Source§fn access<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
requested: AccessMask,
) -> Pin<Box<dyn Future<Output = FsResult<AccessMask>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn access<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
requested: AccessMask,
) -> Pin<Box<dyn Future<Output = FsResult<AccessMask>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns the subset of requested access bits granted for the caller.
Source§fn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
parent: &'life2 Self::Handle,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<Self::Handle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
parent: &'life2 Self::Handle,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<Self::Handle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Looks up a named child in a directory.
Source§fn parent<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
dir: &'life2 Self::Handle,
) -> Pin<Box<dyn Future<Output = FsResult<Option<Self::Handle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn parent<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
dir: &'life2 Self::Handle,
) -> Pin<Box<dyn Future<Output = FsResult<Option<Self::Handle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns the parent of a directory, or
None for the root directory.Source§fn readdir<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
dir: &'life2 Self::Handle,
cookie: u64,
max_entries: u32,
with_attrs: bool,
) -> Pin<Box<dyn Future<Output = FsResult<DirPage<Self::Handle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn readdir<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
dir: &'life2 Self::Handle,
cookie: u64,
max_entries: u32,
with_attrs: bool,
) -> Pin<Box<dyn Future<Output = FsResult<DirPage<Self::Handle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns a page of directory entries starting after
cookie.Source§fn read<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
offset: u64,
count: u32,
) -> Pin<Box<dyn Future<Output = FsResult<ReadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
offset: u64,
count: u32,
) -> Pin<Box<dyn Future<Output = FsResult<ReadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Reads a byte range from an object.
Source§fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
offset: u64,
data: Bytes,
_requested: WriteStability,
) -> Pin<Box<dyn Future<Output = FsResult<WriteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
offset: u64,
data: Bytes,
_requested: WriteStability,
) -> Pin<Box<dyn Future<Output = FsResult<WriteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Writes a byte range to an object.
Source§fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 RequestContext,
parent: &'life2 Self::Handle,
name: &'life3 str,
req: CreateRequest,
) -> Pin<Box<dyn Future<Output = FsResult<CreateResult<Self::Handle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 RequestContext,
parent: &'life2 Self::Handle,
name: &'life3 str,
req: CreateRequest,
) -> Pin<Box<dyn Future<Output = FsResult<CreateResult<Self::Handle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Creates a regular file or directory.
Source§fn remove<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
parent: &'life2 Self::Handle,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn remove<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
parent: &'life2 Self::Handle,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Removes a file or empty directory by name.
Source§fn rename<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
from_dir: &'life2 Self::Handle,
from_name: &'life3 str,
to_dir: &'life4 Self::Handle,
to_name: &'life5 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
from_dir: &'life2 Self::Handle,
from_name: &'life3 str,
to_dir: &'life4 Self::Handle,
to_name: &'life5 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Renames or moves an entry.
Source§fn setattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
attrs: &'life3 SetAttrs,
) -> Pin<Box<dyn Future<Output = FsResult<Attrs>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn setattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 Self::Handle,
attrs: &'life3 SetAttrs,
) -> Pin<Box<dyn Future<Output = FsResult<Attrs>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Applies attribute updates and returns the resulting attrs.
Source§fn xattrs(&self) -> Option<&dyn Xattrs<Self::Handle>>
fn xattrs(&self) -> Option<&dyn Xattrs<Self::Handle>>
Returns optional named-attribute support.
Source§fn hard_links(&self) -> Option<&dyn HardLinks<Self::Handle>>
fn hard_links(&self) -> Option<&dyn HardLinks<Self::Handle>>
Returns optional hard-link support.
Source§fn commit_support(&self) -> Option<&dyn CommitSupport<Self::Handle>>
fn commit_support(&self) -> Option<&dyn CommitSupport<Self::Handle>>
Returns optional explicit commit support.
Source§impl HardLinks<u64> for MemFs
impl HardLinks<u64> for MemFs
Source§fn link<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
source: &'life2 u64,
parent: &'life3 u64,
name: &'life4 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn link<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
source: &'life2 u64,
parent: &'life3 u64,
name: &'life4 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Create a hard link to an existing file.
Source§impl Symlinks<u64> for MemFs
impl Symlinks<u64> for MemFs
Source§fn create_symlink<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
ctx: &'life1 RequestContext,
parent: &'life2 u64,
name: &'life3 str,
target: &'life4 str,
attrs: &'life5 SetAttrs,
) -> Pin<Box<dyn Future<Output = FsResult<CreateResult<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn create_symlink<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
ctx: &'life1 RequestContext,
parent: &'life2 u64,
name: &'life3 str,
target: &'life4 str,
attrs: &'life5 SetAttrs,
) -> Pin<Box<dyn Future<Output = FsResult<CreateResult<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Create a symbolic link and return the created handle and attrs.
Source§fn readlink<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
) -> Pin<Box<dyn Future<Output = FsResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn readlink<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
) -> Pin<Box<dyn Future<Output = FsResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Read a symlink target.
Source§impl Xattrs<u64> for MemFs
impl Xattrs<u64> for MemFs
Source§fn list_xattrs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
) -> Pin<Box<dyn Future<Output = FsResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_xattrs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
) -> Pin<Box<dyn Future<Output = FsResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List all named attributes attached to an object.
Source§fn get_xattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_xattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Fetch a full named-attribute value.
Source§fn set_xattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
name: &'life3 str,
value: Bytes,
mode: XattrSetMode,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_xattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
name: &'life3 str,
value: Bytes,
mode: XattrSetMode,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set or replace a named attribute value.
Source§fn remove_xattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn remove_xattr<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 RequestContext,
handle: &'life2 u64,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Remove a named attribute.
Auto Trait Implementations§
impl !Freeze for MemFs
impl !RefUnwindSafe for MemFs
impl Send for MemFs
impl Sync for MemFs
impl Unpin for MemFs
impl UnsafeUnpin for MemFs
impl !UnwindSafe for MemFs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more