blob: a4c9f06ccf14709e55883a168aba4acb1f230857 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
use crate::proto;
use std::marker::PhantomData;
pub mod io;
#[doc(cfg(feature = "server"))]
pub mod ops;
#[doc(cfg(feature = "mount"))]
pub mod mount;
pub mod session;
mod private_trait {
pub trait Operation<'o> {
type RequestBody: crate::proto::Structured<'o>;
type ReplyTail;
}
}
use private_trait::Operation;
pub type Op<'o, O = ops::Any> = (Request<'o, O>, Reply<'o, O>);
#[doc(cfg(feature = "server"))]
pub struct Request<'o, O: Operation<'o>> {
header: proto::InHeader,
body: O::RequestBody,
}
#[doc(cfg(feature = "server"))]
pub struct Reply<'o, O: Operation<'o>> {
session: &'o session::Session,
unique: u64,
tail: O::ReplyTail,
}
#[must_use]
#[doc(cfg(feature = "server"))]
pub struct Done<'o>(PhantomData<*mut &'o ()>);
impl Done<'_> {
fn done() -> Self {
Done(PhantomData)
}
}
|