diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-04 06:49:48 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-04 06:49:52 -0600 |
| commit | 70baa472b2bee69f205cc1aada304d597b858005 (patch) | |
| tree | 7a0b1a0381b68fe0e091b87d00634ff13568bf6d /src/mod.rs | |
| parent | 1955ec118a32d3fa174496abe5442c82c609273a (diff) | |
Move crate::fuse::* to the top-level
Diffstat (limited to 'src/mod.rs')
| -rw-r--r-- | src/mod.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mod.rs b/src/mod.rs new file mode 100644 index 0000000..84c6878 --- /dev/null +++ b/src/mod.rs @@ -0,0 +1,43 @@ +use crate::proto; +use std::marker::PhantomData; + +pub mod io; +pub mod mount; +pub mod ops; +pub mod session; + +mod private_trait { + pub trait Sealed {} +} + +pub trait Operation<'o>: private_trait::Sealed + Sized { + type RequestBody: crate::proto::Structured<'o>; + type ReplyTail; +} + +pub type Op<'o, O = ops::Any> = (Request<'o, O>, Reply<'o, O>); + +pub struct Request<'o, O: Operation<'o>> { + header: proto::InHeader, + body: O::RequestBody, +} + +#[must_use] +pub struct Reply<'o, O: Operation<'o>> { + session: &'o session::Session, + unique: u64, + tail: O::ReplyTail, +} + +#[must_use] +pub struct Done<'o>(PhantomData<&'o mut &'o ()>); + +impl Done<'_> { + fn new() -> Self { + Done(PhantomData) + } + + fn consume(self) { + drop(self); + } +} |
