pub struct ReadState {
pub type: String,
pub feed_url: String,
pub read_through: Option<String>,
pub read_ids: Vec<String>,
pub unread_ids: Vec<String>,
pub updated_at: String,
}Expand description
community.lexicon.rss.readState — a batched read high-water-mark for a
single feed. Record key: any; the rkey is derived deterministically from the
feed (a hash of the feed URL), so there is one record per feed with a stable
key, NOT one record per article.
feedUrl + updatedAt are required; readThrough is OPTIONAL — it is a
water-mark (“every entry seen/published <= this is read”), so it is written
only once a real high-water-mark exists. Omitting it (rather than synthesizing
a flush-time value) means a brand-new cursor asserts nothing about the backlog:
only the explicit readIds mark entries read. The two capped id-sets carry
out-of-order reads and explicit mark-unread exceptions.
Fields§
§type: StringThe $type NSID discriminator; always nsid::READ_STATE.
feed_url: StringThe feed this cursor covers. Required.
read_through: Option<String>High-water-mark: every entry with seen/published time <= this is READ. Optional — omitted from the record when no local high-water-mark exists yet, so a fresh cursor never implicitly marks the backlog read.
read_ids: Vec<String>Entries newer than readThrough that are ALSO read (out-of-order reads).
Capped at 1000 by the lexicon; empty sets are omitted from the record.
unread_ids: Vec<String>Entries older than readThrough explicitly kept UNREAD (mark-unread).
Capped at 1000 by the lexicon; empty sets are omitted from the record.
updated_at: StringLast time this cursor was flushed (ISO-8601 datetime). Required. Intended
as the tie-breaker for cross-device merges (newest updatedAt wins);
a login-time reconcile that uses it is not implemented yet.
Implementations§
Source§impl ReadState
impl ReadState
Sourcepub const MAX_IDS: usize = 1000
pub const MAX_IDS: usize = 1000
Maximum length of the readIds / unreadIds exception sets, per the
lexicon. The flusher enforces this cap before writing (see
scheduler::cap).
Sourcepub fn new(
feed_url: impl Into<String>,
read_through: Option<String>,
updated_at: impl Into<String>,
) -> Self
pub fn new( feed_url: impl Into<String>, read_through: Option<String>, updated_at: impl Into<String>, ) -> Self
Construct a minimal read cursor with only the required fields.
read_through is optional: pass None for a cursor that has no local
high-water-mark yet, so the record omits readThrough entirely rather than
synthesizing a flush-time value that would mark the backlog read.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ReadState
impl<'de> Deserialize<'de> for ReadState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ReadState
impl StructuralPartialEq for ReadState
Auto Trait Implementations§
impl Freeze for ReadState
impl RefUnwindSafe for ReadState
impl Send for ReadState
impl Sync for ReadState
impl Unpin for ReadState
impl UnsafeUnpin for ReadState
impl UnwindSafe for ReadState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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