pub struct ObligationState {
pub status: ObligationStatus,
pub until: Option<Until>,
pub until_authority: Option<GovernanceLogId>,
pub plan: Option<PostId>,
pub lapsed_at: Option<DateTime<Utc>>,
}Expand description
Where an obligation stands, from its amendments: see
ObligationState::from_amendments
Fields§
§status: ObligationStatus§until: Option<Until>When it is due now: the last reschedule’s, or the obligation’s own
The authority of the reschedule that set until, if one did
plan: Option<PostId>The latest plan
lapsed_at: Option<DateTime<Utc>>When it last lapsed. Kept after a discharge: a late discharge reads as “discharged, lapsed on …”
Implementations§
Source§impl ObligationState
impl ObligationState
Sourcepub fn from_amendments<'a>(
obligation: &ObligationData,
amendments: impl IntoIterator<Item = (DateTime<Utc>, &'a Amendment)>,
) -> Self
pub fn from_amendments<'a>( obligation: &ObligationData, amendments: impl IntoIterator<Item = (DateTime<Utc>, &'a Amendment)>, ) -> Self
The state of obligation (its latest version) after amendments,
those naming it with their created_at, in chain order. Kinds that
are not obligation kinds change nothing here.
A discharge or withdrawal closes it, and the last one wins. A lapse marks an open obligation lapsed, and a reschedule reopens a lapsed one: it has a new due date and has not missed it yet. Neither moves a closed one.
Trait Implementations§
Source§impl Clone for ObligationState
impl Clone for ObligationState
Source§impl Debug for ObligationState
impl Debug for ObligationState
Source§impl Default for ObligationState
impl Default for ObligationState
Source§impl<'de> Deserialize<'de> for ObligationState
impl<'de> Deserialize<'de> for ObligationState
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ObligationState
Source§impl PartialEq for ObligationState
impl PartialEq for ObligationState
Source§impl Serialize for ObligationState
impl Serialize for ObligationState
impl StructuralPartialEq for ObligationState
Auto Trait Implementations§
impl Freeze for ObligationState
impl RefUnwindSafe for ObligationState
impl Send for ObligationState
impl Sync for ObligationState
impl Unpin for ObligationState
impl UnsafeUnpin for ObligationState
impl UnwindSafe for ObligationState
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
Mutably borrows from an owned value. Read more
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,
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§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
Compare self to
key and return true if they are equal.