pub enum VersionState {
Enabled,
Deprecated,
Disabled,
}Expand description
State of a schema version within a subject
Allows managing the lifecycle of schema versions without deletion. This is important for schema evolution and migration workflows.
§State Transitions
┌─────────┐
│ Enabled │ ◄───── Initial state
└────┬────┘
│ deprecate()
▼
┌──────────────┐
│ Deprecated │ ◄───── Warning state
└──────┬───────┘
│ disable()
▼
┌──────────┐
│ Disabled │ ◄───── Blocked state
└──────────┘Variants§
Enabled
Version is active and can be used (default)
Deprecated
Version is deprecated - still usable but clients are warned
Disabled
Version is disabled - cannot be used for new registrations
Implementations§
Source§impl VersionState
impl VersionState
Sourcepub fn requires_warning(&self) -> bool
pub fn requires_warning(&self) -> bool
Check if this state requires client warnings
Sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
Check if this version is blocked from use
Sourcepub fn deprecate(&self) -> VersionState
pub fn deprecate(&self) -> VersionState
Transition to deprecated state
Sourcepub fn disable(&self) -> VersionState
pub fn disable(&self) -> VersionState
Transition to disabled state
Sourcepub fn enable(&self) -> VersionState
pub fn enable(&self) -> VersionState
Transition back to enabled state
Trait Implementations§
Source§impl Clone for VersionState
impl Clone for VersionState
Source§fn clone(&self) -> VersionState
fn clone(&self) -> VersionState
Returns a duplicate of the value. Read more
1.0.0 · 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 VersionState
impl Debug for VersionState
Source§impl Default for VersionState
impl Default for VersionState
Source§fn default() -> VersionState
fn default() -> VersionState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for VersionState
impl<'de> Deserialize<'de> for VersionState
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 Display for VersionState
impl Display for VersionState
Source§impl FromStr for VersionState
impl FromStr for VersionState
Source§impl Hash for VersionState
impl Hash for VersionState
Source§impl PartialEq for VersionState
impl PartialEq for VersionState
Source§impl Serialize for VersionState
impl Serialize for VersionState
impl Copy for VersionState
impl Eq for VersionState
impl StructuralPartialEq for VersionState
Auto Trait Implementations§
impl Freeze for VersionState
impl RefUnwindSafe for VersionState
impl Send for VersionState
impl Sync for VersionState
impl Unpin for VersionState
impl UnsafeUnpin for VersionState
impl UnwindSafe for VersionState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.