pub struct Calendar {
pub events: Vec<EventState>,
pub last_adjourned: Option<DateTime<Utc>>,
pub today: NaiveDate,
}Expand description
Every stored event and what pending means today
Fields§
§events: Vec<EventState>§last_adjourned: Option<DateTime<Utc>>When the Council last adjourned (a cancelled meeting is not a
sitting); None before the first sitting
today: NaiveDateImplementations§
Source§impl Calendar
impl Calendar
Sourcepub fn new(
events: Vec<EventState>,
last_adjourned: Option<DateTime<Utc>>,
now: DateTime<Utc>,
) -> Self
pub fn new( events: Vec<EventState>, last_adjourned: Option<DateTime<Utc>>, now: DateTime<Utc>, ) -> Self
The calendar of events (each at its newest change), as of now
Sourcepub fn pending(&self, e: &EventState) -> bool
pub fn pending(&self, e: &EventState) -> bool
An event that has not happened: no meeting linked, not marked held,
and expected after the last adjournment. The last clause is 073’s
staleness rule: nothing records held yet (the Council program
will), so a sitting is over once one has adjourned after its date.
Sourcepub fn next_sitting(&self) -> Option<&EventState>
pub fn next_sitting(&self) -> Option<&EventState>
The sitting next_sitting means: the earliest pending sitting,
regular or special, that is scheduled
pub fn event(&self, id: CalendarEventId) -> Option<&EventState>
Sourcepub fn resolve(
&self,
until: Option<&Until>,
decided: impl Fn(&GovernanceLogId) -> bool,
) -> Resolved
pub fn resolve( &self, until: Option<&Until>, decided: impl Fn(&GovernanceLogId) -> bool, ) -> Resolved
When until comes to now. decided says whether a decision is in
the log yet, for after_decision.
- a date is itself;
next_sittingis the next sitting’s date, and with none on the calendar, today: it is due as soon as one is held;sittingis that event’s date as it now stands; if the sitting was called off, the obligation carries forward to the next one, likenext_sitting;after_decisionisnext_sittingonce the decision is taken, and undated until then;- undated is undated.
Sourcepub fn sitting_items(
&self,
due_at: &[(CalendarEventId, ObligationStatus)],
) -> Vec<CalendarItem>
pub fn sitting_items( &self, due_at: &[(CalendarEventId, ObligationStatus)], ) -> Vec<CalendarItem>
The stored events still to come, as calendar items: pending sittings
that are scheduled. obligations_due counts the open and lapsed
obligations due at each.
Sourcepub fn upcoming(
&self,
obligations: &[ResolvedObligation],
skip_next: bool,
limit: usize,
) -> Vec<CalendarItem>
pub fn upcoming( &self, obligations: &[ResolvedObligation], skip_next: bool, limit: usize, ) -> Vec<CalendarItem>
What is coming up, soonest first, at most limit items: pending
sittings and obligations due on a date. obligations is every
obligation, resolved against this calendar. skip_next leaves out
the next sitting, for the dashboard, whose Council block already
gives it.
An obligation’s line carries its text (what is owed, in the
recorder’s words), never its quote, which may hold an agent’s.
Trait Implementations§
impl Eq for Calendar
impl StructuralPartialEq for Calendar
Auto Trait Implementations§
impl Freeze for Calendar
impl RefUnwindSafe for Calendar
impl Send for Calendar
impl Sync for Calendar
impl Unpin for Calendar
impl UnsafeUnpin for Calendar
impl UnwindSafe for Calendar
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.