pub enum CreditRegistrationState {
Show 17 variants
Pending,
ReadyToSubmit,
ResolvingEnrolment,
CheckingEnrolment,
NoUsableEnrolment,
Submitting,
SubmissionUncertain,
AwaitingVerification,
PartiallyRegistered,
Registered,
Duplicate,
NotImproved,
Misregistered,
FailedRetryable,
FailedPermanent,
Blocked,
Cancelled,
}Expand description
What the pipeline does next with a ledger row.
Variants§
Pending
Waiting on a precondition: the completion or a linked student number. Which one is derived at read time, never stored.
ReadyToSubmit
ResolvingEnrolment
CheckingEnrolment
NoUsableEnrolment
Submitting
SubmissionUncertain
AwaitingVerification
PartiallyRegistered
Sisu holds the assessment item attainment, and verify keeps polling for the course unit attainment that makes the credit count.
Registered
Duplicate
NotImproved
Misregistered
FailedRetryable
FailedPermanent
Blocked
Cancelled
Implementations§
Source§impl CreditRegistrationState
impl CreditRegistrationState
Sourcepub const ALL: [Self; 17]
pub const ALL: [Self; 17]
Every state, so a classification can be proven exhaustive at runtime too.
Sourcepub const SUCCESS_STATES: [Self; 3]
pub const SUCCESS_STATES: [Self; 3]
Self::is_success’s states, for binding as = ANY($n::credit_registration_state[]) in
queries that would otherwise hand-retype the same set as a SQL literal. Order-independent;
kept in is_success’s own order for readability.
Sourcepub const OTHER_SUCCESS_STATES: [Self; 2]
pub const OTHER_SUCCESS_STATES: [Self; 2]
Self::SUCCESS_STATES minus Registered: the credit exists but we did not put it there.
Sourcepub const IN_FLIGHT_STATES: [Self; 4]
pub const IN_FLIGHT_STATES: [Self; 4]
The states of a row whose submission may be in Sisu with its outcome not yet known: a request may be out, or its answer is still to be verified.
Sourcepub const HARD_FAILURE_STATES: [Self; 2]
pub const HARD_FAILURE_STATES: [Self; 2]
The two states a “failed” count means across the admin reports: a permanent submit failure and a reversal the study registry made after the fact.
Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
States the pipeline never leaves on its own. terminal_at tracks membership, cleared on
exit so an admin retry becomes visible to the stuck queries again.
Sourcepub fn is_failed_state(self) -> bool
pub fn is_failed_state(self) -> bool
Entry to one of these anchors the retry window in first_failed_at. Not the same question
as whether a move carries an error code.
Sourcepub fn is_success(self) -> bool
pub fn is_success(self) -> bool
Used for reporting and for the double-registration guard.
Sourcepub fn allowed_targets(self) -> &'static [Self]
pub fn allowed_targets(self) -> &'static [Self]
The states the pipeline itself may move a row from self to, staying put excluded.
The one place the shape of the machine is written down: every edge here is one a phase, the
precondition recompute or the grade-improvement materialiser actually takes, and
transition refuses anything else. Admin-only edges live in
ADMIN_ONLY_TARGETS instead, kept out of reach of a phase that could take one by mistake.
Sourcefn may_resend_after_sending(self, strictness: ResubmissionStrictness) -> bool
fn may_resend_after_sending(self, strictness: ResubmissionStrictness) -> bool
Whether a row that has been sent may be sent again from this state. The outcomes lead a
possibly landed import back towards import only on Suotar’s notRegistered, so the
pipeline states here mean nothing landed.
Sourcepub(super) fn pending_supersession_effect(self) -> PendingSupersessionEffect
pub(super) fn pending_supersession_effect(self) -> PendingSupersessionEffect
What an attempt entering self does to the rows it was sent to replace; see
mark_pending_superseded.
Sourcepub fn keeps_enrolment_check_schedule(self) -> bool
pub fn keeps_enrolment_check_schedule(self) -> bool
The states of the wait for an enrolment: no_usable_enrolment, and those a first check or a
retried lookup passes through on its way there. Entering any other clears the check
schedule.
Sourcepub(super) fn default_attempt_delay(self) -> TimeDelta
pub(super) fn default_attempt_delay(self) -> TimeDelta
How long a row entering this state waits before the pipeline may claim it again, when the
caller of transition names no time of its own. Zero leaves it
claimable at once.
Only the states a claim query reads, or a precondition arm holds a row in, need a nonzero
one: a phase that forgot to defer would otherwise spin on the row, since every claim orders
by next_attempt_at. A caller with a real backoff to apply passes it and overrides this.
Trait Implementations§
Source§impl Clone for CreditRegistrationState
impl Clone for CreditRegistrationState
Source§fn clone(&self) -> CreditRegistrationState
fn clone(&self) -> CreditRegistrationState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for CreditRegistrationState
impl ComposeSchema for CreditRegistrationState
Source§impl Debug for CreditRegistrationState
impl Debug for CreditRegistrationState
Source§impl<'r> Decode<'r, Postgres> for CreditRegistrationState
impl<'r> Decode<'r, Postgres> for CreditRegistrationState
Source§impl<'de> Deserialize<'de> for CreditRegistrationState
impl<'de> Deserialize<'de> for CreditRegistrationState
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>,
Source§impl<'q, DB: Database> Encode<'q, DB> for CreditRegistrationStatewhere
&'q str: Encode<'q, DB>,
impl<'q, DB: Database> Encode<'q, DB> for CreditRegistrationStatewhere
&'q str: Encode<'q, DB>,
Source§fn encode_by_ref(
&self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer, ) -> Result<IsNull, BoxDynError>
fn size_hint(&self) -> usize
§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
Source§impl Hash for CreditRegistrationState
impl Hash for CreditRegistrationState
Source§impl PartialEq for CreditRegistrationState
impl PartialEq for CreditRegistrationState
Source§impl PgHasArrayType for CreditRegistrationState
impl PgHasArrayType for CreditRegistrationState
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
Source§impl Serialize for CreditRegistrationState
impl Serialize for CreditRegistrationState
Source§impl ToSchema for CreditRegistrationState
impl ToSchema for CreditRegistrationState
Source§impl Type<Postgres> for CreditRegistrationState
impl Type<Postgres> for CreditRegistrationState
impl Copy for CreditRegistrationState
impl Eq for CreditRegistrationState
impl StructuralPartialEq for CreditRegistrationState
Auto Trait Implementations§
impl Freeze for CreditRegistrationState
impl RefUnwindSafe for CreditRegistrationState
impl Send for CreditRegistrationState
impl Sync for CreditRegistrationState
impl Unpin for CreditRegistrationState
impl UnsafeUnpin for CreditRegistrationState
impl UnwindSafe for CreditRegistrationState
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].