summaryrefslogtreecommitdiff
path: root/src/ops/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ops/traits.rs')
-rw-r--r--src/ops/traits.rs13
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>,