pub trait Manager<T> {
type Protocol: Protocol + Send + 'static;
type Args: Clone + Send + 'static;
type Message: Clone + Send + 'static;
type Event: Clone + Debug + Send + 'static;
type Error: StdError + Send + Sync + 'static;
// Required methods
fn from_args(args: Self::Args) -> Self;
fn session(
&mut self,
session_id: u64,
config: &SessionConfig<T>,
) -> impl Future<Output = Self::Protocol>;
fn session_handle(
&self,
session_id: u64,
) -> impl Future<Output = Option<Pin<Box<dyn Sink<ToSync<Self::Message>, Error = Self::Error>>>>>;
fn subscribe(
&mut self,
) -> impl Stream<Item = FromSync<Self::Event>> + Send + Unpin + 'static;
}Expand description
Interface for managing sync sessions and consuming events they emit.
Required Associated Types§
type Protocol: Protocol + Send + 'static
type Args: Clone + Send + 'static
type Message: Clone + Send + 'static
type Event: Clone + Debug + Send + 'static
type Error: StdError + Send + Sync + 'static
Required Methods§
fn from_args(args: Self::Args) -> Self
Sourcefn session(
&mut self,
session_id: u64,
config: &SessionConfig<T>,
) -> impl Future<Output = Self::Protocol>
fn session( &mut self, session_id: u64, config: &SessionConfig<T>, ) -> impl Future<Output = Self::Protocol>
Instantiate a new sync session.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.