summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-01-05 02:52:04 -0600
committerAlejandro Soto <alejandro@34project.org>2022-01-05 02:52:04 -0600
commit75cced9d4c101ec2f9f04ed95621ff3a3f750eae (patch)
treea8ff3fa46a75b18ee3c1133aa6fc0857132d6115 /examples
parentff17b04143dde5157808be5bcf1cbf8a942db4c4 (diff)
Refactor impls of Reply as individual traits
Diffstat (limited to 'examples')
-rw-r--r--examples/ext2.rs10
-rw-r--r--examples/passthrough.rs6
2 files changed, 8 insertions, 8 deletions
diff --git a/examples/ext2.rs b/examples/ext2.rs
index 0a1722e..dd55867 100644
--- a/examples/ext2.rs
+++ b/examples/ext2.rs
@@ -347,7 +347,7 @@ impl Ext2 {
let ino = request.ino();
let (reply, inode) = reply.and_then(self.inode(ino))?;
- reply.known(&Resolved { ino, inode })
+ reply.stat(&Resolved { ino, inode })
}
async fn lookup<'o>(&self, (request, reply): Op<'o, ops::Lookup>) -> Done<'o> {
@@ -370,9 +370,9 @@ impl Ext2 {
};
if let Some(inode) = inode {
- reply.found(inode, Ttl::MAX)
+ reply.known(inode, Ttl::MAX)
} else {
- reply.not_found(Ttl::MAX)
+ reply.not_found_for(Ttl::MAX)
}
}
@@ -387,7 +387,7 @@ impl Ext2 {
let size = inode.i_size as usize;
if size < size_of::<[u32; 15]>() {
- return reply.target(OsStr::from_bytes(&cast_slice(&inode.i_block)[..size]));
+ return reply.slice(&cast_slice(&inode.i_block)[..size]);
}
/* This is unlikely to ever spill, and is guaranteed not to
@@ -407,7 +407,7 @@ impl Ext2 {
offset += segment.len() as u64;
}
- reply.gather_target(&segments)
+ reply.gather(&segments)
}
async fn readdir<'o>(&self, (request, reply): Op<'o, ops::Readdir>) -> Done<'o> {
diff --git a/examples/passthrough.rs b/examples/passthrough.rs
index 5ecb2e8..1607f10 100644
--- a/examples/passthrough.rs
+++ b/examples/passthrough.rs
@@ -102,7 +102,7 @@ impl Passthrough {
let path = parent.path.join(request.name());
let (reply, metadata) = reply.and_then(fs::symlink_metadata(&path).await)?;
- reply.found(New(&mut self.known, Inode::new(path, metadata)), Ttl::MAX)
+ reply.known(New(&mut self.known, Inode::new(path, metadata)), Ttl::MAX)
}
fn forget<'o>(&mut self, (request, reply): Op<'o, ops::Forget>) -> Done<'o> {
@@ -124,14 +124,14 @@ impl Passthrough {
fn getattr<'o>(&mut self, (request, reply): Op<'o, ops::Getattr>) -> Done<'o> {
let (reply, inode) = reply.and_then(self.known(request.ino()))?;
- reply.known(inode)
+ reply.stat(inode)
}
async fn readlink<'o>(&mut self, (request, reply): Op<'o, ops::Readlink>) -> Done<'o> {
let (reply, inode) = reply.and_then(self.known(request.ino()))?;
let (reply, target) = reply.and_then(fs::read_link(&inode.path).await)?;
- reply.target(&target)
+ reply.blob(&target)
}
async fn open<'o>(&mut self, (request, reply): Op<'o, ops::Open>) -> Done<'o> {