Skip to content

Commit 2dc19bc

Browse files
committed
Allow users to create Notifier objects when handling requests
1 parent 7f338a9 commit 2dc19bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/request.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use crate::ll::Request as _;
1818
use crate::reply::ReplyDirectoryPlus;
1919
use crate::reply::{Reply, ReplyDirectory, ReplySender};
2020
use crate::session::{Session, SessionACL};
21-
use crate::Filesystem;
2221
use crate::{ll, KernelConfig};
22+
use crate::{Filesystem, Notifier};
2323

2424
/// Request data structure
2525
#[derive(Debug)]
@@ -643,6 +643,12 @@ impl<'a> Request<'a> {
643643
Reply::new(self.request.unique().into(), self.ch.clone())
644644
}
645645

646+
/// Create a [Notifier] that can be used to send notifications back to the
647+
/// kernel.
648+
pub fn notifier(&self) -> Notifier {
649+
Notifier::new(self.ch.clone())
650+
}
651+
646652
/// Returns the unique identifier of this request
647653
#[inline]
648654
pub fn unique(&self) -> u64 {

0 commit comments

Comments
 (0)