pub struct TopicSyncManager<T, S, M, L, E>where
T: Clone,
E: Extensions,{ /* private fields */ }Expand description
Create and manage topic log sync sessions.
Sync sessions are created via the manager, which instantiates them with access to the shared topic map and operation store as well as channels for receiving sync events and for sending newly arriving operations in live mode.
A handle can be acquired to a sync session via the session_handle method for sending any live mode operations to a specific session. It’s expected that users map sessions (by their id) to any topic subscriptions in order to understand the correct mappings.
Implementations§
Source§impl<T, S, M, L, E> TopicSyncManager<T, S, M, L, E>where
T: Clone,
E: Extensions,
impl<T, S, M, L, E> TopicSyncManager<T, S, M, L, E>where
T: Clone,
E: Extensions,
Trait Implementations§
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,
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,
Source§async fn session(
&mut self,
session_id: u64,
config: &SessionConfig<T>,
) -> Self::Protocol
async fn session( &mut self, session_id: u64, config: &SessionConfig<T>, ) -> Self::Protocol
Instantiate a new sync session.
Source§async fn session_handle(
&self,
session_id: u64,
) -> Option<Pin<Box<dyn Sink<ToTopicSync<E>, Error = Self::Error>>>>
async fn session_handle( &self, session_id: u64, ) -> Option<Pin<Box<dyn Sink<ToTopicSync<E>, Error = Self::Error>>>>
Retrieve a handle to a running sync session.
Source§fn subscribe(
&mut self,
) -> impl Stream<Item = FromSync<Self::Event>> + Send + Unpin + 'static
fn subscribe( &mut self, ) -> impl Stream<Item = FromSync<Self::Event>> + Send + Unpin + 'static
Subscribe to the event stream for all running sync sessions.
type Protocol = TopicLogSync<T, S, M, L, E>
type Args = TopicSyncManagerArgs<S, M>
type Event = TopicLogSyncEvent<E>
type Message = Operation<E>
type Error = TopicSyncManagerError
Auto Trait Implementations§
impl<T, S, M, L, E> Freeze for TopicSyncManager<T, S, M, L, E>
impl<T, S, M, L, E> !RefUnwindSafe for TopicSyncManager<T, S, M, L, E>
impl<T, S, M, L, E> Send for TopicSyncManager<T, S, M, L, E>
impl<T, S, M, L, E> Sync for TopicSyncManager<T, S, M, L, E>
impl<T, S, M, L, E> Unpin for TopicSyncManager<T, S, M, L, E>
impl<T, S, M, L, E> !UnwindSafe for TopicSyncManager<T, S, M, L, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more