pub struct SeriesRef {
pub id: String,
pub name: Option<String>,
pub date: Option<String>,
pub key: Option<String>,
pub rule: Option<SeriesRule>,
pub state: Option<SeriesLifecycle>,
pub next_cursor: Option<String>,
pub skipped: Vec<String>,
}Expand description
One table, two roles, told apart by which fields are set — the definition
carries rule, an occurrence carries key/date. A role: flag would be a
second source of truth a writer could disagree with, so there is none:
[crate::recurrence::series::SeriesRef::role] derives it.
Identity is (id, date) and never the issue number, the title, or the
filename (C-002): those are display values that move, and an occurrence that
moved with them would be generated twice.
Fields§
§id: StringThe stable series id. Required in both roles.
name: Option<String>The series’ display name. Mutable label, never identity; on the definition, and copied onto an occurrence for readability.
date: Option<String>The canonical local date key (YYYY-MM-DD) an occurrence was generated
for. Set on occurrences only.
key: Option<String>The occurrence’s idempotency key (<series-id>@<YYYY-MM-DD>). Stored
rather than re-derived, so a file whose key the current rule would no
longer produce is still readable — and still a no-op (C-006).
rule: Option<SeriesRule>The schedule, as the file spells it. Set on the definition only.
state: Option<SeriesLifecycle>The lifecycle state. Set on the definition only.
next_cursor: Option<String>The generation cursor: the last date the generator considered. Set on the definition only.
skipped: Vec<String>Occurrence dates the user explicitly skipped, so generation never recreates them (C-006). Set on the definition only.
Implementations§
Source§impl SeriesRef
impl SeriesRef
Sourcepub fn role(&self) -> SeriesRole
pub fn role(&self) -> SeriesRole
The role this table plays, decided by its fields (see the module docs).
A table with a rule is a definition; anything else is an occurrence — a
table with neither is an occurrence missing its key, which
SeriesIndex::build reports rather than guessing at.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SeriesRef
impl<'de> Deserialize<'de> for SeriesRef
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 SeriesRef
impl StructuralPartialEq for SeriesRef
Auto Trait Implementations§
impl Freeze for SeriesRef
impl RefUnwindSafe for SeriesRef
impl Send for SeriesRef
impl Sync for SeriesRef
impl Unpin for SeriesRef
impl UnsafeUnpin for SeriesRef
impl UnwindSafe for SeriesRef
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<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