Rollouts

Struct Rollouts 

Source
pub struct Rollouts<'a> {
    pub(super) conn: &'a Mutex<Connection>,
}

Fields§

§conn: &'a Mutex<Connection>

Implementations§

Source§

impl Rollouts<'_>

Source

pub fn record_rollout_opened( &self, rollout_id: &str, channel: &str, target_ref: &str, opened_at: DateTime<Utc>, opened_event_log_seq: Option<i64>, ) -> Result<()>

Pure-insert of a new Opening-state rollout row. Idempotent on rollout_id PK (INSERT OR IGNORE) — no side effects on other rows.

Supersession of prior in-flight rollouts on the same channel is driven through the rollout reducer (Phase 10c): the applier snapshots in-flight predecessors, calls this method, then routes a RolloutEvent::SuccessorOpened per predecessor through process_rollout_event. The reducer transitions each predecessor from its current state to Superseded and emits a RolloutEffect::RecordRolloutTransition that the applier writes via record_rollout_transition. Closes the last RFC-0004 §3 “implicit side effect” anti-pattern in Phase 10.

Source

pub fn record_rollout_transition( &self, rollout_id: &str, to: RolloutState, at: DateTime<Utc>, event_log_seq: Option<i64>, ) -> Result<usize>

Record a state transition on an existing rollout row. Stamps the state column, the appropriate timestamp side-effect (terminal_at / superseded_at), and the last_transition_event_log_seq FK.

Idempotent on (rollout_id, target_state): if the row is already at to, the UPDATE no-ops via the WHERE state != ? guard.

Source

pub fn set_current_wave( &self, rollout_id: &str, wave: u32, event_log_seq: Option<i64>, ) -> Result<usize>

Monotonic wave-index advance; WHERE current_wave < ?2 blocks concurrent ticks from racing backwards. Stamps the last_transition_event_log_seq FK alongside.

Source

pub fn current_wave(&self, rollout_id: &str) -> Result<Option<u32>>

Source

pub fn state(&self, rollout_id: &str) -> Result<Option<RolloutRow>>

Full row projection, or None if the rollout is unknown. Callers project state directly; the v0.1 is_superseded/is_terminal/ is_finished boolean derivations are gone (use state == RolloutState::X reads).

Source

pub fn list_active(&self) -> Result<GateRollouts>

Gate-observed source. Filters Superseded and Pruned only — terminal rollouts stay visible so channel-edges can detect “predecessor converged”. UI consumers should use list_in_flight.

Source

pub fn list_in_flight(&self) -> Result<UiRollouts>

UI source. Filters Superseded, Pruned, AND Terminal (operator’s “done” view).

Source

fn list_filtered(&self, exclude_terminal: bool) -> Result<Vec<ActiveRollout>>

Source

pub fn prune_finished_rollouts( &self, max_age_hours: i64, ) -> Result<(usize, usize)>

Prune finished (Superseded | Terminal | Failed | Reverted) rollouts past max_age_hours AND their host_rollout_records rows. Returns (host_rollout_records_pruned, rollouts_pruned).

Phase 10b: this physical-deletion pass becomes a RetentionExpired event emission instead, transitioning the row to Pruned (the row persists for audit; v0.3 retention- compaction handles physical deletion per RFC-0008 §3 + §13). For 10a we keep the physical prune so the existing operator workflow stays unchanged while the rollout reducer is unimplemented.

Auto Trait Implementations§

§

impl<'a> Freeze for Rollouts<'a>

§

impl<'a> RefUnwindSafe for Rollouts<'a>

§

impl<'a> Send for Rollouts<'a>

§

impl<'a> Sync for Rollouts<'a>

§

impl<'a> Unpin for Rollouts<'a>

§

impl<'a> UnwindSafe for Rollouts<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more