pub struct SingleTimeline { /* private fields */ }Expand description
A cursor that walks one feed backward through time, yielding encoded posts page by page.
Every feed in hashiverse — a user’s profile, a hashtag, a mention stream, a reply thread
— is represented on the wire as a sequence of time-bucketed post bundles keyed by a
single Id (the “base id” of the feed) and a BucketType. SingleTimeline is the
client-side state machine that reads such a feed: given a wall-clock time_millis and a
desired page size, each call to get_more_posts walks to the next-older bucket via
RecursiveBucketVisitor, pulls the bundle through a PostBundleManager, and emits
the posts in reverse chronological order while deduplicating against post_ids_already_seen.
It also reads from the shared RecentPostsPen so posts the local user has just
authored appear at the top of the feed before they have propagated through the network.
For aggregated feeds (following multiple people, multiple hashtags) see MultipleTimeline,
which composes several SingleTimelines.
Implementations§
Source§impl SingleTimeline
impl SingleTimeline
pub fn new( bucket_type: BucketType, location_id: &Id, post_bundle_manager: Arc<dyn PostBundleManager>, recent_posts_pen: Arc<RwLock<RecentPostsPen>>, ) -> Self
pub fn bucket_type(&self) -> BucketType
pub fn base_id(&self) -> Id
pub async fn get_more_posts( &mut self, time_millis: TimeMillis, max_posts: usize, bucket_durations: &[DurationMillis], ) -> Result<Vec<(BucketLocation, Bytes)>>
pub fn post_count(&self) -> usize
pub fn oldest_allowed_post_bundle_time_millis(&self) -> TimeMillis
pub fn oldest_processed_post_bundle_time_millis(&self) -> TimeMillis
Auto Trait Implementations§
impl Freeze for SingleTimeline
impl !RefUnwindSafe for SingleTimeline
impl Send for SingleTimeline
impl Sync for SingleTimeline
impl Unpin for SingleTimeline
impl UnsafeUnpin for SingleTimeline
impl !UnwindSafe for SingleTimeline
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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