diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-05 07:00:49 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-05 07:00:49 -0600 |
| commit | c1bd6716bd53cb4270eeb032f150ac2c7c1a8f96 (patch) | |
| tree | 9688880bdc4d141211a000bcf1769b926dd0212c /src/ops/traits.rs | |
| parent | b424e909fb65eb5c77a4ba4082492b11278103d4 (diff) | |
Implement Mkdir
Diffstat (limited to 'src/ops/traits.rs')
| -rw-r--r-- | src/ops/traits.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ops/traits.rs b/src/ops/traits.rs index 70e529a..9808358 100644 --- a/src/ops/traits.rs +++ b/src/ops/traits.rs @@ -1,5 +1,5 @@ use crate::{ - io::{Entry, FsInfo, Interruptible, Known, Stat}, + io::{Entry, FsInfo, Interruptible, Known, Mode, Stat}, Done, Ino, Operation, Reply, Request, Ttl, }; @@ -41,6 +41,10 @@ pub trait RequestFlags<'o>: Operation<'o> { fn flags(request: &Request<'o, Self>) -> Self::Flags; } +pub trait RequestMode<'o>: Operation<'o> { + fn mode(request: &Request<'o, Self>) -> Mode; +} + pub trait ReplyOk<'o>: Operation<'o> { fn ok(reply: Reply<'o, Self>) -> Done<'o> { reply.empty() @@ -128,6 +132,13 @@ impl<'o, O: Operation<'o>> Request<'o, O> { O::flags(self) } + pub fn mode(&self) -> Mode + where + O: RequestMode<'o>, + { + O::mode(self) + } + pub fn forget_list(&self) -> impl '_ + Iterator<Item = (Ino, u64)> where O: RequestForget<'o>, |
