Skip to main content

MemFs

Struct MemFs 

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

In-memory filesystem implementation used by tests and examples.

Implementations§

Source§

impl MemFs

Source

pub fn new() -> Self

Creates a new empty in-memory filesystem.

Trait Implementations§

Source§

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,

Flush buffered writes for a byte range.
Source§

impl Default for MemFs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FileSystem for MemFs

Source§

type Handle = u64

Opaque stable handle type for backend objects.
Source§

fn root(&self) -> Self::Handle

Returns the root handle for the exported filesystem.
Source§

fn capabilities(&self) -> FsCapabilities

Returns static capability flags.
Source§

fn limits(&self) -> FsLimits

Returns static filesystem limits.
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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

Applies attribute updates and returns the resulting attrs.
Source§

fn xattrs(&self) -> Option<&dyn Xattrs<Self::Handle>>

Returns optional named-attribute support.
Returns optional symlink support.
Returns optional hard-link support.
Source§

fn commit_support(&self) -> Option<&dyn CommitSupport<Self::Handle>>

Returns optional explicit commit support.
Source§

impl HardLinks<u64> for MemFs

Create a hard link to an existing file.
Source§

impl Symlinks<u64> for MemFs

Create a symbolic link and return the created handle and attrs.
Read a symlink target.
Source§

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,

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,

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,

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,

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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more