pub trait FsMount: Mount {
Show 13 methods
// Required methods
fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
mode: u32,
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn unlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn mkdir<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
mode: u32,
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn rmdir<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn rename<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
from: &'life1 [&'life2 str],
to: &'life3 [&'life4 str],
caller: &'life5 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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 setattr<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
attr: &'life3 SetAttr,
caller: &'life4 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn symlink<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
target: &'life3 str,
caller: &'life4 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn readlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<String, MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn link<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
existing: &'life1 [&'life2 str],
new_path: &'life3 [&'life4 str],
caller: &'life5 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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 stat_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<Stat, MountError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided methods
fn is_whiteout<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<bool, MountError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn is_opaque<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<bool, MountError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn set_opaque<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
A full, writable filesystem mount — the hyprstream overlay interface.
Extends Mount (walk/open/read/write/readdir/stat/clunk) with the
namespace-mutation surface a writable or overlay filesystem needs:
create, unlink/rmdir/mkdir, rename, setattr, symlink/readlink,
link, and the overlay whiteout / opaque-dir hooks.
The v1 backend (crate::overlay) wraps fuse_backend_rs::OverlayFs, which
implements copy-up and whiteouts internally — so an FsMount impl that
delegates to it does not hand-roll copy-on-write. A future native CoW
engine (backlog #370) implements this same trait directly.
Required Methods§
Sourcefn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
mode: u32,
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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,
path: &'life1 [&'life2 str],
mode: u32,
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create (and leave on disk) a regular file at path with mode.
Fails with MountError::AlreadyExists if the final component exists.
On an overlay this triggers copy-up of the parent directory as needed and
places the new file in the writable upper layer.
Sourcefn unlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn unlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Remove a non-directory entry (file, symlink, fifo, …) at path.
On an overlay, removing an entry that exists only in a lower (read-only) layer is realised as a whiteout in the upper layer — the lower entry is masked, never mutated.
Sourcefn mkdir<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
mode: u32,
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn mkdir<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
mode: u32,
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create a directory at path with mode.
Sourcefn rmdir<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn rmdir<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Remove an empty directory at path.
Fails with MountError::NotDirectory if path is not a directory and
(per POSIX) an error if it is non-empty. Overlay whiteout rules apply as
for unlink.
Sourcefn rename<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
from: &'life1 [&'life2 str],
to: &'life3 [&'life4 str],
caller: &'life5 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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,
from: &'life1 [&'life2 str],
to: &'life3 [&'life4 str],
caller: &'life5 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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,
Rename from to to, atomically replacing to if it exists.
from and to are both rooted at the mount root and may live in
different directories. Across overlay layers this implies copy-up of the
source plus a whiteout at the old location, all handled by the backend.
Sourcefn setattr<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
attr: &'life3 SetAttr,
caller: &'life4 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn setattr<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
attr: &'life3 SetAttr,
caller: &'life4 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Change file attributes (chmod / chown / truncate / utimes).
Only the populated fields of SetAttr are applied. A size change on
a lower-layer file forces copy-up.
Sourcefn symlink<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
target: &'life3 str,
caller: &'life4 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn symlink<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
target: &'life3 str,
caller: &'life4 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Create a symbolic link at path whose target is target.
target is stored verbatim (it may be absolute or relative and is not
resolved by this call).
Sourcefn readlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<String, MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn readlink<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<String, MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Read the target of the symbolic link at path.
Sourcefn link<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
existing: &'life1 [&'life2 str],
new_path: &'life3 [&'life4 str],
caller: &'life5 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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 link<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
existing: &'life1 [&'life2 str],
new_path: &'life3 [&'life4 str],
caller: &'life5 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + 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 hard link at new_path referring to the same inode as
existing.
Sourcefn stat_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<Stat, MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn stat_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 [&'life2 str],
caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<Stat, MountError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Stat a path directly (without holding a fid), returning its metadata.
Convenience over walk + stat + clunk for the mutating ops above,
which routinely need to probe existence/type. Backends should implement
it in terms of their own fid machinery.
Provided Methods§
Sourcefn is_whiteout<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<bool, MountError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn is_whiteout<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<bool, MountError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Report whether path resolves to a whiteout — an upper-layer marker that
masks an entry present in a lower layer. Default: false (no overlay).
Sourcefn is_opaque<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<bool, MountError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn is_opaque<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<bool, MountError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Report whether the directory at path is opaque — i.e. it hides the
contents of the same directory in all lower layers. Default: false.
Sourcefn set_opaque<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_opaque<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_path: &'life1 [&'life2 str],
_caller: &'life3 Subject,
) -> Pin<Box<dyn Future<Output = Result<(), MountError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Mark the directory at path opaque, hiding lower-layer contents.
Default: MountError::NotSupported — a backend with no layering cannot
honour opacity and must say so rather than silently no-op (fail-closed).