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>
impl<T> GapFill<T>
Sourcepub fn new(session_id: impl Into<String>) -> Self
pub fn new(session_id: impl Into<String>) -> Self
Empty fill state for one session, with no gap pending.
Sourcepub const fn is_current(&self) -> bool
pub const fn is_current(&self) -> bool
Whether no gap is pending.
Sourcepub const fn pending_gap(&self) -> Option<&ViewGapParams>
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.
Sourcepub fn begin_gap(
&mut self,
gap: ViewGapParams,
) -> Result<Option<ViewPageParams>, GapFillError>
pub fn begin_gap( &mut self, gap: ViewGapParams, ) -> Result<Option<ViewPageParams>, GapFillError>
Record a delivery gap and start, or extend, its single forward walk.
Sourcepub fn reattach(&mut self) -> Option<ViewPageParams>
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.
Sourcepub fn apply(
&mut self,
event: GapEvent<T>,
apply: impl FnMut(T),
) -> Result<ApplyOutcome, GapFillError>
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.
Sourcepub fn accept_page(
&mut self,
page: GapPage<T>,
apply: impl FnMut(T),
) -> Result<GapAdvance, GapFillError>
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.