pub struct RemappedFilesystem<F, A> {
pub inner: F,
pub mapping: BiBTreeMap<u64, u64>,
pub allocator: A,
}
Expand description
Wraps a Filesystem
and remaps its inodes.
Fields§
§inner: F
§mapping: BiBTreeMap<u64, u64>
§allocator: A
Implementations§
Source§impl<F, A: InodeAllocator> RemappedFilesystem<F, A>
impl<F, A: InodeAllocator> RemappedFilesystem<F, A>
Trait Implementations§
Source§impl<A: InodeAllocator + Send + Sync, F: Filesystem + Send + Sync> Filesystem for RemappedFilesystem<F, A>
impl<A: InodeAllocator + Send + Sync, F: Filesystem + Send + Sync> Filesystem for RemappedFilesystem<F, A>
type Error = Error<<F as Filesystem>::Error>
Source§fn inodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BTreeSet<u64>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BTreeSet<u64>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the set of inodes from the filesystem. Read more
Source§fn destroy<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn destroy<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close filesystem. See also
fuser::Filesystem::destroy
.Source§fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
parent: u64,
name: &'life1 OsStr,
) -> Pin<Box<dyn Future<Output = Result<FileAttr, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
parent: u64,
name: &'life1 OsStr,
) -> Pin<Box<dyn Future<Output = Result<FileAttr, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lookup an entry by name in a directory. See also
fuser::Filesystem::lookup
.Source§fn open<'life0, 'async_trait>(
&'life0 self,
ino: u64,
flags: i32,
) -> Pin<Box<dyn Future<Output = Result<u64, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open<'life0, 'async_trait>(
&'life0 self,
ino: u64,
flags: i32,
) -> Pin<Box<dyn Future<Output = Result<u64, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open a file and get a handle. See also
fuser::Filesystem::open
.Source§fn release<'life0, 'async_trait>(
&'life0 self,
ino: u64,
fh: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn release<'life0, 'async_trait>(
&'life0 self,
ino: u64,
fh: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Release a file handle. See also
fuser::Filesystem::release
.Source§fn getattr<'life0, 'async_trait>(
&'life0 self,
ino_ext: u64,
) -> Pin<Box<dyn Future<Output = Result<FileAttr, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn getattr<'life0, 'async_trait>(
&'life0 self,
ino_ext: u64,
) -> Pin<Box<dyn Future<Output = Result<FileAttr, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get attributes on an entry. See also
fuser::Filesystem::getattr
.Source§fn setattr<'life0, 'async_trait>(
&'life0 mut self,
ino_ext: u64,
size: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<FileAttr, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn setattr<'life0, 'async_trait>(
&'life0 mut self,
ino_ext: u64,
size: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<FileAttr, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set attributes. Currently only supports setting the size
Source§fn readdir<'life0, 'async_trait>(
&'life0 self,
ino: u64,
offset: u64,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = DirEntry> + Send + Sync + '_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readdir<'life0, 'async_trait>(
&'life0 self,
ino: u64,
offset: u64,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = DirEntry> + Send + Sync + '_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read a directory.
To be called repeatedly by specifying a gradually increasing offset,
until the returned iterator is empty. A minimum of two calls is required
to be certain that the end has been reached.
offset
represents the index of the starting element.
See also fuser::Filesystem::readdir
.Source§fn read<'life0, 'async_trait>(
&'life0 self,
ino: u64,
fh: u64,
offset: i64,
size: u32,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read<'life0, 'async_trait>(
&'life0 self,
ino: u64,
fh: u64,
offset: i64,
size: u32,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read from a file. See also
fuser::Filesystem::read
.Source§fn write<'life0, 'async_trait>(
&'life0 self,
ino: u64,
fh: u64,
data: Bytes,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<u32, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write<'life0, 'async_trait>(
&'life0 self,
ino: u64,
fh: u64,
data: Bytes,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<u32, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write to file. See also
fuser::Filesystem::write
.Source§fn create<'life0, 'async_trait>(
&'life0 mut self,
parent: u64,
name: OsString,
mode: u32,
umask: u32,
flags: i32,
) -> Pin<Box<dyn Future<Output = Result<(FileAttr, u64), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 mut self,
parent: u64,
name: OsString,
mode: u32,
umask: u32,
flags: i32,
) -> Pin<Box<dyn Future<Output = Result<(FileAttr, u64), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create and open a file. See also
fuser::Filesystem::create
.Source§impl<A: InodeAllocator + Send + Sync, F: Filesystem + Refresh + Send + Sync> Refresh for RemappedFilesystem<F, A>
impl<A: InodeAllocator + Send + Sync, F: Filesystem + Refresh + Send + Sync> Refresh for RemappedFilesystem<F, A>
Auto Trait Implementations§
impl<F, A> Freeze for RemappedFilesystem<F, A>
impl<F, A> RefUnwindSafe for RemappedFilesystem<F, A>where
F: RefUnwindSafe,
A: RefUnwindSafe,
impl<F, A> Send for RemappedFilesystem<F, A>
impl<F, A> Sync for RemappedFilesystem<F, A>
impl<F, A> Unpin for RemappedFilesystem<F, A>
impl<F, A> UnwindSafe for RemappedFilesystem<F, A>where
F: UnwindSafe,
A: UnwindSafe,
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
Source§impl<F> InodeAllocator for F
impl<F> InodeAllocator for F
type Error = <F as Filesystem>::Error
Source§fn allocate<'life0, 'async_trait>(
&'life0 mut self,
_n: usize,
) -> Pin<Box<dyn Future<Output = Result<u64, <F as InodeAllocator>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
F: 'async_trait,
fn allocate<'life0, 'async_trait>(
&'life0 mut self,
_n: usize,
) -> Pin<Box<dyn Future<Output = Result<u64, <F as InodeAllocator>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
F: 'async_trait,
Reserve a continuous number of inodes, returning the start.
The range is disjoint from the previously allocated ones.