pub(crate) struct FeedSource {
broker: Arc<Broker>,
filestore: Arc<FileStore>,
global_store: Option<Arc<FileStore>>,
mstore: Arc<Store>,
hub: Arc<FeedHub>,
block_id: String,
}Expand description
Where a feed reads its agent’s transcript from.
Fields§
§broker: Arc<Broker>§filestore: Arc<FileStore>§global_store: Option<Arc<FileStore>>§mstore: Arc<Store>§hub: Arc<FeedHub>§block_id: StringImplementations§
Source§impl FeedSource
impl FeedSource
pub(crate) fn of(state: &AppState, block_id: &str) -> Self
async fn read( &self, offset: u64, expect_gen: &str, tail: bool, ) -> Option<BlockfileReadRangeResult>
async fn position(&self) -> Option<(String, String, u64)>
Sourceasync fn snapshot(&self) -> Option<Snapshot>
async fn snapshot(&self) -> Option<Snapshot>
The tail, through the bounded range read. Retried when the transcript
is replaced between the count and the read; None if it keeps moving
or can’t be read.
Sourceasync fn resume(&self, gen: &str, line: u64) -> Option<(Cursor, Vec<String>)>
async fn resume(&self, gen: &str, line: u64) -> Option<(Cursor, Vec<String>)>
The lines from line on, for a reconnect that sent gen:line: None
when the transcript has another generation now, or more has been
written since than a stream may fall behind by (a snapshot then).
Sourceasync fn catch_up(&self, cursor: &mut Cursor) -> CatchUp
async fn catch_up(&self, cursor: &mut Cursor) -> CatchUp
Lines of the agent’s shared transcript past cursor that no event of
this block brought: another block, or another srv instance, running
the same agent wrote them, or this block’s append didn’t say where it
landed in the shared stream. Moves the cursor past what it returns.
Lines an event brings later are then skipped by line number
(feed::apply_append), so nothing is sent twice.
A cursor on the block’s own transcript is left to its events, unless the transcript is now read from another stream: the agent’s shared transcript started after the snapshot (another srv instance may have begun it, and its appends reach no event here).
Auto Trait Implementations§
impl !RefUnwindSafe for FeedSource
impl !UnwindSafe for FeedSource
impl Freeze for FeedSource
impl Send for FeedSource
impl Sync for FeedSource
impl Unpin for FeedSource
impl UnsafeUnpin for FeedSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more