summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2021-12-28 21:59:56 -0600
committerAlejandro Soto <alejandro@34project.org>2021-12-28 21:59:56 -0600
commite78c003bc555a5cb9396c5d65d3a9831507813de (patch)
tree12be9957fbfe6a300b3d60e066e76cde81df65d4
parent5308f999f95343d3d232e6e9258ea607f0a05dad (diff)
Expose Operation<'o> in the public API
Diffstat (limited to '')
-rw-r--r--src/fuse/mod.rs10
-rw-r--r--src/fuse/ops.rs3
2 files changed, 7 insertions, 6 deletions
diff --git a/src/fuse/mod.rs b/src/fuse/mod.rs
index a4c9f06..5893d79 100644
--- a/src/fuse/mod.rs
+++ b/src/fuse/mod.rs
@@ -12,13 +12,13 @@ pub mod mount;
pub mod session;
mod private_trait {
- pub trait Operation<'o> {
- type RequestBody: crate::proto::Structured<'o>;
- type ReplyTail;
- }
+ pub trait Sealed {}
}
-use private_trait::Operation;
+pub trait Operation<'o>: private_trait::Sealed {
+ type RequestBody: crate::proto::Structured<'o>;
+ type ReplyTail;
+}
pub type Op<'o, O = ops::Any> = (Request<'o, O>, Reply<'o, O>);
diff --git a/src/fuse/ops.rs b/src/fuse/ops.rs
index 4727d10..f715e12 100644
--- a/src/fuse/ops.rs
+++ b/src/fuse/ops.rs
@@ -18,8 +18,9 @@ use super::{
macro_rules! op {
{ $name:ident $operation:tt } => {
- pub struct $name(());
+ pub struct $name(std::convert::Infallible);
+ impl super::private_trait::Sealed for $name {}
impl<'o> Operation<'o> for $name $operation
};