ferrite_session/internal/base/protocol/
traits.rs1use core::{
2 future::Future,
3 pin::Pin,
4};
5
6pub trait SealedProtocol {}
7
8pub trait Protocol: SealedProtocol + Send + 'static
9{
10 type ProviderEndpoint: Send + 'static;
11 type ClientEndpoint: Send + 'static;
12
13 fn create_endpoints() -> (Self::ProviderEndpoint, Self::ClientEndpoint);
14
15 fn forward(
16 client_end: Self::ClientEndpoint,
17 provider_end: Self::ProviderEndpoint,
18 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>;
19}
20
21pub trait SealedSharedProtocol {}
22
23pub trait SharedProtocol: SealedSharedProtocol + Send + 'static {}