Skip to main content

ReplicationManualRunPhase

Enum ReplicationManualRunPhase 

Source
pub enum ReplicationManualRunPhase {
    Pending,
    Running,
    Succeeded,
    Failed,
    Unknown(String),
}
Expand description

Lifecycle of an annotation-requested (on-demand) replication run, shared by RepositoryReplication and SnapshotReplication.

Closed on the wire, open on decode — the same contract every kopiur phase carries (see the phase_serde! macro): the CRD schema admits exactly Pending/Running/Succeeded/Failed, and Self::Unknown exists only so a value written by a NEWER kopiur decodes instead of failing the typed watch for the whole Kind.

It has a Pending variant that crate::ManualRunPhase does not: a replication can be suspend: true when the request lands, and a request that cannot start yet must be VISIBLE rather than silently queued.

use kopiur_api::common::ReplicationManualRunPhase;

assert_eq!(serde_json::to_value(ReplicationManualRunPhase::Pending).unwrap(), "Pending");
// An unrecognized phase from a newer operator decodes instead of erroring.
let p: ReplicationManualRunPhase = serde_json::from_value(serde_json::json!("Queued")).unwrap();
assert_eq!(p, ReplicationManualRunPhase::Unknown("Queued".into()));
assert_eq!(serde_json::to_value(&p).unwrap(), "Queued");

Variants§

§

Pending

The request is recorded but no Job can start yet (the replication is suspend: true); it runs when the block clears.

§

Running

The mover Job for this request is in flight.

§

Succeeded

The requested run completed successfully.

§

Failed

The requested run’s Job failed; conditions carry the detail.

§

Unknown(String)

A phase string this build does not recognize (newer operator, or legacy stored data). Decode-compat only — hidden from the CRD schema, never produced by this build. Never counted as a finished run, so a re-run request is never deduped against it.

Implementations§

Source§

impl ReplicationManualRunPhase

Source

pub fn is_unknown(&self) -> bool

Whether this is the decode-compat Self::Unknown sentinel. The exhaustive match lives here so a variant added later cannot be silently classified by an if let … Unknown(_) probe elsewhere.

Source

pub fn implies_job_launched(&self) -> bool

Whether this phase says a mover Job for the request EXISTS OR EXISTED.

The controller’s “the Job vanished before its outcome was observed” check: Running with no Job present means a TTL reap beat the reconcile, and re-running side-effectful work silently would be worse than reporting the lost outcome. Exhaustive rather than an equality so a phase added later must state whether it implies a Job was launched — under == the new variant would silently take the “no Job ever ran” branch.

Source

pub fn answers_request(&self) -> bool

Whether this phase ANSWERS the request it is recorded against — i.e. the run reached a terminal outcome, so re-applying the same run-requested value is a no-op.

Exhaustive on purpose: this predicate decides whether a user’s run request is DROPPED, so a new phase must state whether it counts as an answer. Unknown is deliberately NOT an answer — re-driving is idempotent (the Job name is keyed on the request timestamp), whereas dropping the request loses the run.

Trait Implementations§

Source§

impl Clone for ReplicationManualRunPhase

Source§

fn clone(&self) -> ReplicationManualRunPhase

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReplicationManualRunPhase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ReplicationManualRunPhase

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ReplicationManualRunPhase

Source§

impl JsonSchema for ReplicationManualRunPhase

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn json_schema(_: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

impl PartialEq for ReplicationManualRunPhase

Source§

fn eq(&self, other: &ReplicationManualRunPhase) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PhaseLabel for ReplicationManualRunPhase

Source§

const ALL: &'static [Self]

Every canonical variant, in declaration order. Never contains Unknown.
Source§

fn label(&self) -> &str

The stable metric/wire label string for this variant (exhaustive match); the Unknown arm echoes the stored value verbatim so a read-modify-write never mutates a phase this build does not understand.
Source§

fn unknown(raw: String) -> Self

Build the decode-compat fallback for a non-canonical stored string. Implemented by the phase_serde! macro’s host enum.
Source§

fn parse(s: &str) -> Option<Self>

Parse a canonical label; None for anything else (including a value that would decode to Unknown). Derived from ALL + label() so a new variant is parseable the moment it is declared.
Source§

fn canonical() -> Vec<&'static str>

The canonical label set, for the CRD schema enum and “valid values” messages. One definition, derived from ALL.
Source§

impl Serialize for ReplicationManualRunPhase

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ReplicationManualRunPhase

Auto Trait Implementations§

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<T> AnyExt for T
where T: Any + ?Sized,

§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
§

impl<T> AsDebug for T
where T: Debug,

§

fn as_debug(&self) -> &dyn Debug

Returns self as a &dyn Debug trait object.
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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

§

fn coerce_box_to(self: Box<X>) -> Box<T>

§

fn coerce_ref_to(&self) -> &T

§

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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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: Sized + 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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> TryIntoValue for T
where T: Serialize,

§

type Error = SerializationError

§

fn try_into_value(self) -> Result<Value, <T as TryIntoValue>::Error>

§

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