#[non_exhaustive]pub enum MigrationState {
Planned,
InProgress {
processed: usize,
total: usize,
skipped: usize,
},
Paused {
processed: usize,
total: usize,
skipped: usize,
reason: String,
},
Completed {
processed: usize,
skipped: usize,
duration_secs: f64,
},
Failed {
processed: usize,
total: usize,
skipped: usize,
error: String,
},
Cancelled {
processed: usize,
total: usize,
skipped: usize,
},
}Expand description
Migration state machine states.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Planned
Migration is planned but has not started.
InProgress
Migration is actively processing embeddings.
Fields
Paused
Migration is paused (can be resumed).
Fields
Completed
Migration completed successfully.
Fields
Failed
Migration failed with an error.
Fields
Cancelled
Migration was cancelled by the operator.
Implementations§
Source§impl MigrationState
impl MigrationState
Sourcepub fn is_resumable(&self) -> bool
pub fn is_resumable(&self) -> bool
Returns true if the migration can be resumed (paused or failed).
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if the migration has reached a terminal state (completed or cancelled).
Sourcepub fn progress(&self) -> Option<f64>
pub fn progress(&self) -> Option<f64>
Returns the progress as a fraction in [0.0, 1.0], or None if not applicable.
Sourcepub fn effective_total(&self) -> usize
pub fn effective_total(&self) -> usize
Returns total minus skipped – the number of embeddings that actually need processing.
Sourcepub fn effective_coverage(&self) -> f64
pub fn effective_coverage(&self) -> f64
Returns the fraction of effective_total that has been processed (0.0 to 1.0).
Trait Implementations§
Source§impl Clone for MigrationState
impl Clone for MigrationState
Source§fn clone(&self) -> MigrationState
fn clone(&self) -> MigrationState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MigrationState
impl Debug for MigrationState
Source§impl<'de> Deserialize<'de> for MigrationState
impl<'de> Deserialize<'de> for MigrationState
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
Source§impl PartialEq for MigrationState
impl PartialEq for MigrationState
Source§fn eq(&self, other: &MigrationState) -> bool
fn eq(&self, other: &MigrationState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MigrationState
impl Serialize for MigrationState
impl StructuralPartialEq for MigrationState
Auto Trait Implementations§
impl Freeze for MigrationState
impl RefUnwindSafe for MigrationState
impl Send for MigrationState
impl Sync for MigrationState
impl Unpin for MigrationState
impl UnsafeUnpin for MigrationState
impl UnwindSafe for MigrationState
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