Skip to main content

PosixVfs

Struct PosixVfs 

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

POSIX backend rooted at a single directory.

Implementations§

Source§

impl PosixVfs

Source

pub fn new(root: impl Into<PathBuf>) -> Self

Create a backend serving root.

Trait Implementations§

Source§

impl Debug for PosixVfs

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Vfs for PosixVfs

Source§

fn create<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, is_dir: bool, access: u32, disposition: u32, options: u32, _attrs: u32, ) -> Pin<Box<dyn Future<Output = VfsResult<(Box<OpenFile>, FileMeta, u32)>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or open rel according to the NT-style parameters. Read more
Source§

fn read<'life0, 'life1, 'async_trait>( &'life0 self, open: &'life1 mut OpenFile, offset: u64, len: usize, ) -> Pin<Box<dyn Future<Output = VfsResult<Vec<u8>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read up to len bytes at offset.
Source§

fn write<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, open: &'life1 mut OpenFile, offset: u64, data: &'life2 [u8], write_through: bool, ) -> Pin<Box<dyn Future<Output = VfsResult<u64>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Write data at offset, returning bytes written. When write_through is set the data must reach stable storage before returning.
Source§

fn seek<'life0, 'life1, 'async_trait>( &'life0 self, open: &'life1 mut OpenFile, mode: u16, offset: i64, ) -> Pin<Box<dyn Future<Output = VfsResult<u64>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reposition the file pointer; mode follows the SMB1 SEEK semantics (0 = from start, 1 = current, 2 = from end) and returns the new offset.
Source§

fn flush<'life0, 'life1, 'async_trait>( &'life0 self, open: &'life1 mut OpenFile, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Flush one handle.
Source§

fn flush_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Flush every handle the backend currently keeps.
Source§

fn close<'life0, 'async_trait>( &'life0 self, open: Box<OpenFile>, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close a handle, applying pending deletion when requested.
Source§

fn mkdir<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a directory.
Source§

fn rmdir<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove an (empty) directory.
Source§

fn check_dir<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Verify a directory exists.
Delete exactly one file (never directories).
Source§

fn delete_pattern<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir_rel: &'life1 str, pattern: &'life2 str, ) -> Pin<Box<dyn Future<Output = VfsResult<bool>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete all files matching pattern inside directory dir_rel; returns whether anything was removed. Wildcards */? honoured.
Source§

fn rename<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, old_rel: &'life1 str, new_rel: &'life2 str, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Rename old_rel to new_rel.
Source§

fn list<'life0, 'life1, 'async_trait>( &'life0 self, dir_rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<Vec<Entry>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List entries of dir_rel with metadata snapshots.
Source§

fn stat<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<FileMeta>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stat a path without opening it.
Source§

fn set_info_open<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, open: &'life1 mut OpenFile, op: &'life2 SetOp, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Apply one neutral set-information operation to an open handle.
Source§

fn set_info_path<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, rel: &'life1 str, op: &'life2 SetOp, ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Apply one neutral set-information operation to a path.
Source§

fn query_disk<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = VfsResult<(u32, u32, u16, u16)>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query disk (total_units, free_units, sectors_per_unit, bytes_per_sector).
Source§

fn get_security<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<Option<Vec<u8>>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the raw self-relative NT security descriptor stored for rel ([MS-DTYP] §2.4.6), or None when the backend has none (the caller then synthesises a default). Default backends store nothing.
Source§

fn set_security<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, rel: &'life1 str, descriptor: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = VfsResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Persist a raw self-relative NT security descriptor for rel. Default backends accept and discard it (no ACL storage).
Source§

fn list_streams<'life0, 'life1, 'async_trait>( &'life0 self, rel: &'life1 str, ) -> Pin<Box<dyn Future<Output = VfsResult<Vec<(String, u64)>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List the alternate data streams of rel as (smb_stream_name, size) pairs (e.g. :Zone.Identifier:$DATA), excluding the default ::$DATA stream which the caller derives from the file size. Default: none.
§

fn zero_range<'life0, 'life1, 'async_trait>( &'life0 self, open: &'life1 mut OpenFile, offset: u64, len: u64, ) -> Pin<Box<dyn Future<Output = Result<(), VfsError>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Zero the byte range [offset, offset + len) of an open handle (FSCTL_SET_ZERO_DATA). The default writes zeros through [Vfs::write]; backends may override to punch a sparse hole.

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.