Skip to main content

FeedSource

Struct FeedSource 

Source
pub struct FeedSource { /* private fields */ }
Expand description

Generation-aware wrapper: owns the generation number alongside the backlog. The runtime persists generation via kevy-persist’s feed sidecars; this type only holds the in-memory value.

Implementations§

Source§

impl FeedSource

Source

pub fn new(generation: u64, source: ReplicationSource) -> Self

Wrap a backlog at an explicit generation (loaded from the feed sidecar at boot, or 1 for a fresh data dir).

Source

pub fn generation(&self) -> u64

Current generation.

Source

pub fn source(&self) -> &ReplicationSource

Access the wrapped backlog (push side + replica streaming keep their existing ReplicationSource API).

Source

pub fn source_mut(&mut self) -> &mut ReplicationSource

Mutable access for push_mutation / drop_up_to.

Source

pub fn bump_generation(&mut self)

Break continuity: bump the generation and restart offsets at 0 (FLUSHALL / restore / unclean-boot policy). The backlog empties — frames from the old generation must never be served under the new one.

Source

pub fn tail(&self) -> (u64, u64)

The tail cursor: (generation, next_offset) — where a consumer resuming after a rebuild starts.

Source

pub fn read( &self, cursor_gen: u64, offset: u64, max: usize, ) -> Result<Vec<FeedFrame<'_>>, FeedRead>

Serve up to max frames at cursor (generation, offset).

  • Stale generation → Resync (any pre-bump cursor is unservable — uniqueness of (gen, offset) forbids re-serving).
  • Generation from the future → Future (caller confusion).
  • Evicted offset → Resync with the current tail.

Auto Trait Implementations§

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