summaryrefslogtreecommitdiff
path: root/src/ops/traits.rs
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-01-06 11:04:26 -0600
committerAlejandro Soto <alejandro@34project.org>2022-01-06 11:04:26 -0600
commitf0e7c0997553ab356d5aa683d5322ab2de575188 (patch)
tree825a83b83668539fe110b6ad25ed714e1e73edc9 /src/ops/traits.rs
parentb9a99211a54d62f556fdf71d5eb91107f11398cf (diff)
Implement Create
Diffstat (limited to '')
-rw-r--r--src/ops/traits.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ops/traits.rs b/src/ops/traits.rs
index 883f2f8..3a81e85 100644
--- a/src/ops/traits.rs
+++ b/src/ops/traits.rs
@@ -44,6 +44,7 @@ pub trait RequestFlags<'o>: Operation<'o> {
pub trait RequestMode<'o>: Operation<'o> {
fn mode(request: &Request<'o, Self>) -> Mode;
+ fn umask(request: &Request<'o, Self>) -> Mode;
}
pub trait ReplyOk<'o>: Operation<'o> {
@@ -140,6 +141,13 @@ impl<'o, O: Operation<'o>> Request<'o, O> {
O::mode(self)
}
+ pub fn umask(&self) -> Mode
+ where
+ O: RequestMode<'o>,
+ {
+ O::umask(self)
+ }
+
pub fn forget_list(&self) -> impl '_ + Iterator<Item = (Ino, u64)>
where
O: RequestForget<'o>,
@@ -200,11 +208,18 @@ impl<'o, O: Operation<'o>> Reply<'o, O> {
pub fn ok_with_handle(self, handle: u64) -> Done<'o>
where
- O: ReplyOpen<'o>,
+ O: ReplyOpen<'o> + ReplyOk<'o>,
{
O::ok_with_handle(self, handle)
}
+ pub fn known_with_handle(self, known: impl Known, ttl: Ttl, handle: u64) -> Done<'o>
+ where
+ O: ReplyOpen<'o> + ReplyKnown<'o>,
+ {
+ O::known_with_handle(self, known, ttl, handle)
+ }
+
pub fn force_direct_io(&mut self)
where
O: ReplyOpen<'o>,