diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-03 07:13:53 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-03 07:13:53 -0600 |
| commit | 2b6a6881cb1e816f7eb0327c0bef5e643889af2c (patch) | |
| tree | f1cd17faf3666c8394f7d489278e9663453b8ddd /src/fuse/io.rs | |
| parent | dc95a1a9f4abed042d2350eda2e870de20545be9 (diff) | |
Split io::Known into io::Known and io::Stat
Diffstat (limited to '')
| -rw-r--r-- | src/fuse/io.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/fuse/io.rs b/src/fuse/io.rs index 3d2445e..c0356ff 100644 --- a/src/fuse/io.rs +++ b/src/fuse/io.rs @@ -25,10 +25,16 @@ pub enum Interruptible<'o, O: Operation<'o>, T> { Interrupted(Done<'o>), } -pub trait Known { +pub trait Stat { fn ino(&self) -> Ino; fn inode_type(&self) -> EntryType; fn attrs(&self) -> (Attrs, Ttl); +} + +pub trait Known { + type Inode: Stat; + + fn inode(&self) -> &Self::Inode; fn unveil(self); } @@ -271,7 +277,7 @@ impl Attrs { }) } - pub(crate) fn finish(self, inode: &impl Known) -> proto::Attrs { + pub(crate) fn finish(self, inode: &impl Stat) -> proto::Attrs { let Ino(ino) = inode.ino(); let inode_type = match inode.inode_type() { EntryType::Fifo => SFlag::S_IFIFO, |
