TopicSyncManager

Struct TopicSyncManager 

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

Source

pub fn new(topic_map: M, store: S) -> Self

Trait Implementations§

Source§

impl<T, S: Debug, M: Debug, L: Debug, E> Debug for TopicSyncManager<T, S, M, L, E>
where T: Clone + Debug, E: Extensions + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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,

Source§

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

Instantiate a manager from arguments.

Source§

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

Retrieve a handle to a running sync session.

Source§

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

Subscribe to the event stream for all running sync sessions.

Source§

type Protocol = TopicLogSync<T, S, M, L, E>

Source§

type Args = TopicSyncManagerArgs<S, M>

Source§

type Event = TopicLogSyncEvent<E>

Source§

type Message = Operation<E>

Source§

type Error = TopicSyncManagerError

Auto Trait Implementations§

§

impl<T, S, M, L, E> Freeze for TopicSyncManager<T, S, M, L, E>
where M: Freeze, S: Freeze,

§

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>
where M: Send, S: Send, L: Send, T: Send, E: Send,

§

impl<T, S, M, L, E> Sync for TopicSyncManager<T, S, M, L, E>
where M: Sync, S: Sync, L: Sync, T: Sync + Send, E: Send,

§

impl<T, S, M, L, E> Unpin for TopicSyncManager<T, S, M, L, E>
where M: Unpin, S: Unpin, L: Unpin, T: Unpin,

§

impl<T, S, M, L, E> !UnwindSafe for TopicSyncManager<T, S, M, L, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more