Skip to content

Struct client::CursorTable

zaun_community_protocol::client::CursorTable · Struct

pub struct CursorTable { … }

The member cursor and one cursor per channel.

SPEC: the protocol does not say where a channel’s cursor starts when the client has none (a new channel, or one it never listed). It starts at 0, so a first event above 1 is a gap and sync.resume reports the channel’s floor, which then raises the cursor.

pub fn resume_bodies(&self) -> Vec<Resume>

sync.resume bodies for every tracked stream, at most 100 channels each.

pub const fn member(&self) -> u64

The member-stream cursor.

pub fn channel(&self, id: &ChannelId) -> Option<u64>

A channel’s cursor, if tracked.

pub fn set_member(&mut self, seq: u64)

Sets the member cursor exactly (after a snapshot, the protocol), dropping held events.

pub fn set_channel(&mut self, id: ChannelId, seq: u64)

Sets a channel cursor exactly (after paging history), dropping held events.

pub fn remove_channel(&mut self, id: &ChannelId)

Stops tracking a channel (lost access, sync.resume.hidden).

pub fn seed(&mut self, cursors: &Cursors)

Raises cursors to the given ones (binding responses); never lowers them.

Clone, Debug, Default

Full rustdoc page