Skip to main content

Manager

Trait Manager 

Source
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§

Source

type Protocol: Protocol + Send + 'static

Source

type Args: Clone + Send + 'static

Source

type Message: Clone + Send + 'static

Source

type Event: Clone + Debug + Send + 'static

Source

type Error: StdError + Send + Sync + 'static

Required Methods§

Source

fn from_args(args: Self::Args) -> Self

Source

fn session( &mut self, session_id: u64, config: &SessionConfig<T>, ) -> impl Future<Output = Self::Protocol>

Instantiate a new sync session.

Source

fn session_handle( &self, session_id: u64, ) -> impl Future<Output = Option<Pin<Box<dyn Sink<ToSync<Self::Message>, Error = Self::Error>>>>>

Retrieve a send handle to an already existing sync session.

Source

fn subscribe( &mut self, ) -> impl Stream<Item = FromSync<Self::Event>> + Send + Unpin + 'static

Subscribe to the manager event stream.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, S, L, E> Manager<T> for TopicSyncManager<T, S, L, E>
where T: Clone + Debug + Eq + StdHash + Serialize + for<'a> Deserialize<'a> + Send + 'static, S: LogStore<Operation<E>, VerifyingKey, L, SeqNum, Hash> + TopicStore<T, VerifyingKey, L> + Clone + Send + 'static, L: LogId + Debug + Send + 'static, E: Extensions + Send + 'static,