Skip to content

Commit 3eefa9a

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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/request.rs

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use crate::reply::ReplyDirectoryPlus;
1919
use crate::reply::{Reply, ReplyDirectory, ReplySender};
2020
use crate::session::{Session, SessionACL};
2121
use crate::Filesystem;
22+
#[cfg(feature = "abi-7-11")]
23+
use crate::Notifier;
2224
use crate::{ll, KernelConfig};
2325

2426
/// Request data structure
@@ -643,6 +645,13 @@ impl<'a> Request<'a> {
643645
Reply::new(self.request.unique().into(), self.ch.clone())
644646
}
645647

648+
/// Create a [Notifier] that can be used to send notifications back to the
649+
/// kernel.
650+
#[cfg(feature = "abi-7-11")]
651+
pub fn notifier(&self) -> Notifier {
652+
Notifier::new(self.ch.clone())
653+
}
654+
646655
/// Returns the unique identifier of this request
647656
#[inline]
648657
pub fn unique(&self) -> u64 {

0 commit comments

Comments
 (0)