Skip to main content

GapFill

Struct GapFill 

Source
pub struct GapFill<T> { /* private fields */ }
Expand description

Synchronous splice-fill state for one session.

The facade’s Session (its gap route) owns the view/page round trips and calls Self::accept_page with the raw, lossless page. Every delivered value reaches the same callback used by Self::apply, so paged and live events share one downstream path.

Implementations§

Source§

impl<T> GapFill<T>

Source

pub fn new(session_id: impl Into<String>) -> Self

Empty fill state for one session, with no gap pending.

Source

pub const fn is_current(&self) -> bool

Whether no gap is pending.

Source

pub const fn pending_gap(&self) -> Option<&ViewGapParams>

The pending gap, with its next cursor extended by any later gap that arrived during the fill.

Source

pub fn begin_gap( &mut self, gap: ViewGapParams, ) -> Result<Option<ViewPageParams>, GapFillError>

Record a delivery gap and start, or extend, its single forward walk.

Source

pub fn reattach(&mut self) -> Option<ViewPageParams>

Reissue the page after a failed walk on a replacement transport.

An already in-flight request returns None so reattach cannot create a redelivery race. This deliberately does not construct session/resume or reconcile commands; those are owned by the facade and pending-command layers.

Source

pub fn apply( &mut self, event: GapEvent<T>, apply: impl FnMut(T), ) -> Result<ApplyOutcome, GapFillError>

Feed one live event through the same application boundary used by a fill.

Source

pub fn accept_page( &mut self, page: GapPage<T>, apply: impl FnMut(T), ) -> Result<GapAdvance, GapFillError>

Accept one raw page, advancing or atomically splicing it into the fold.

Trait Implementations§

Source§

impl<T: Debug> Debug for GapFill<T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Forget for GapFill<T>

§

impl<T> Freeze for GapFill<T>
where Vec<GapEvent<T>>: Freeze,

§

impl<T> Move for GapFill<T>

§

impl<T> RefUnwindSafe for GapFill<T>

§

impl<T> Send for GapFill<T>
where Vec<GapEvent<T>>: Send,

§

impl<T> Sync for GapFill<T>
where Vec<GapEvent<T>>: Sync,

§

impl<T> Unpin for GapFill<T>
where Vec<GapEvent<T>>: Unpin,

§

impl<T> UnsafeUnpin for GapFill<T>

§

impl<T> UnwindSafe for GapFill<T>
where Vec<GapEvent<T>>: UnwindSafe,

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.