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", so this trait is not object safe.

Implementors§

Source§

impl<T, S, M, L, E> Manager<T> for TopicSyncManager<T, S, M, L, E>
where T: Clone + Debug + Eq + StdHash + Serialize + for<'a> Deserialize<'a> + Send + 'static, S: LogStore<L, E> + OperationStore<L, E> + Send + 'static, M: TopicMap<T, Logs<L>> + Send + 'static, L: LogId + for<'de> Deserialize<'de> + Serialize + Send + 'static, E: Extensions + Send + 'static,