pub struct Obligation {
pub id: GovernanceLogId,
pub created_at: DateTime<Utc>,
pub chain_seq: u64,
pub data: ObligationData,
pub state: ObligationState,
}Expand description
An obligation (OBL-…): the signed entry as the log has it now, its
latest version and what its amendments add up to.
The one type for an obligation. What was signed (ObligationData)
and what it adds up to (ObligationState) are kept apart inside it on
purpose: the first is covered by a signature and never changes but by a
revision; the second is derived and does, and must never be signed by
mistake. Everything else (the to-do list’s rows, the calendar’s
deadlines, the serving types) is derived from this.
Fields§
§id: GovernanceLogId§created_at: DateTime<Utc>§chain_seq: u64§data: ObligationDataIts latest version, every revision applied
state: ObligationStateWhat its amendments add up to
Implementations§
Source§impl Obligation
impl Obligation
Sourcepub fn from_log(
id: GovernanceLogId,
created_at: DateTime<Utc>,
chain_seq: u64,
data: &Value,
amendments: &[(DateTime<Utc>, Amendment)],
) -> Result<Self, ObligationError>
pub fn from_log( id: GovernanceLogId, created_at: DateTime<Utc>, chain_seq: u64, data: &Value, amendments: &[(DateTime<Utc>, Amendment)], ) -> Result<Self, ObligationError>
The entry id with its stored data, after amendments: those
naming it, with their created_at, in chain order. Revisions are
applied to data for the latest version, and the state is folded
from all of them (ObligationState::from_amendments).
Sourcepub fn awaited_decision(&self) -> Option<&GovernanceLogId>
pub fn awaited_decision(&self) -> Option<&GovernanceLogId>
The after_decision decision its current deadline waits on: what
a server looks up before crate::calendar::ResolvedObligation::new
Source§impl Obligation
impl Obligation
Sourcepub fn check_amendment(
&self,
amendment: &Amendment,
entry: impl Fn(&GovernanceLogId) -> Option<KnownEntry>,
) -> Result<(), ObligationRuleError>
pub fn check_amendment( &self, amendment: &Amendment, entry: impl Fn(&GovernanceLogId) -> Option<KnownEntry>, ) -> Result<(), ObligationRuleError>
Whether amendment may be appended to this obligation as it now
stands. entry looks up an entry of the log by id.
The rules (agora docs/design-obligations.md):
planned: anyone may record one;discharged: the Steward’s for Steward- and staff-owed obligations; a Council-owed one needs a Council decision asauthority;lapsed: only a dated, open obligation lapses;rescheduled,withdrawn: by whoever set the deadline. If a Council decision did (the source, or the authority of the last reschedule),authoritymust be a Council decision. A Council-owed obligation is withdrawn only by the Council;- a
revisionnever touchesOBLIGATION_FIXED. One that narrowstextis a partial discharge: if the Council owes the obligation or set its deadline, it needs a Council decision too. Its other fields are clerical.
A Council decision that authorizes anything here is later than the obligation and than the decision that set its deadline. Nothing but a revision or another non-obligation kind amends a closed obligation, and those kinds are otherwise not this method’s business.
Trait Implementations§
Source§impl Clone for Obligation
impl Clone for Obligation
Source§impl Debug for Obligation
impl Debug for Obligation
impl Eq for Obligation
Source§impl PartialEq for Obligation
impl PartialEq for Obligation
impl StructuralPartialEq for Obligation
Auto Trait Implementations§
impl Freeze for Obligation
impl RefUnwindSafe for Obligation
impl Send for Obligation
impl Sync for Obligation
impl Unpin for Obligation
impl UnsafeUnpin for Obligation
impl UnwindSafe for Obligation
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.