Skip to main content

TransportBinding

Trait TransportBinding 

Source
pub trait TransportBinding: BidiBinding
where Self::GroupMessage: Clone, Self::WelcomeMessage: Clone,
{ type Cursor: Copy + Send + Debug + From<u64> + Into<u64> + 'static; // Required methods fn build_mutate( adds: impl IntoIterator<Item = (Topic, Self::Cursor)>, removes: impl IntoIterator<Item = Topic>, mutate_id: u64, ) -> Self::Mutate; fn group_topic(msg: &Self::GroupMessage) -> Option<Topic>; fn welcome_topic(msg: &Self::WelcomeMessage) -> Option<Topic>; fn group_cursor(msg: &Self::GroupMessage) -> Option<Self::Cursor>; fn welcome_cursor(msg: &Self::WelcomeMessage) -> Option<Self::Cursor>; fn group_envelope(msg: &Self::GroupMessage) -> &ServerEnvelope; fn welcome_envelope(msg: &Self::WelcomeMessage) -> &ServerEnvelope; fn advance(position: &mut Self::Cursor, delivered: Self::Cursor); fn covers(position: &Self::Cursor, delivered: &Self::Cursor) -> bool; fn meet(a: Self::Cursor, b: Self::Cursor) -> Self::Cursor; }
Expand description

Map backend envelopes to topics and positions for the lease ledger.

Required Associated Types§

Source

type Cursor: Copy + Send + Debug + From<u64> + Into<u64> + 'static

A position that can represent each fixed backend target.

Required Methods§

Source

fn build_mutate( adds: impl IntoIterator<Item = (Topic, Self::Cursor)>, removes: impl IntoIterator<Item = Topic>, mutate_id: u64, ) -> Self::Mutate

Build an update with a nonzero ID. IDs increase on each connection.

Source

fn group_topic(msg: &Self::GroupMessage) -> Option<Topic>

Source

fn welcome_topic(msg: &Self::WelcomeMessage) -> Option<Topic>

Source

fn group_cursor(msg: &Self::GroupMessage) -> Option<Self::Cursor>

Source

fn welcome_cursor(msg: &Self::WelcomeMessage) -> Option<Self::Cursor>

Source

fn group_envelope(msg: &Self::GroupMessage) -> &ServerEnvelope

Source

fn welcome_envelope(msg: &Self::WelcomeMessage) -> &ServerEnvelope

Source

fn advance(position: &mut Self::Cursor, delivered: Self::Cursor)

Source

fn covers(position: &Self::Cursor, delivered: &Self::Cursor) -> bool

Return true when the position is at or above the delivered cursor.

Source

fn meet(a: Self::Cursor, b: Self::Cursor) -> Self::Cursor

Return the greatest cursor covered by both positions.

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§