pub struct MigrationCompatibility { /* private fields */ }Expand description
A checked crate-version range for a migration artifact.
Use Self::contains when deciding whether the running adapter may apply it.
Implementations§
Source§impl MigrationCompatibility
impl MigrationCompatibility
Sourcepub const fn try_new(
minimum: CrateVersion,
maximum: Option<CrateVersion>,
) -> Result<Self, MigrationCompatibilityError>
pub const fn try_new( minimum: CrateVersion, maximum: Option<CrateVersion>, ) -> Result<Self, MigrationCompatibilityError>
Constructs a compatibility range, rejecting a maximum below its minimum.
§Errors
Returns an error when the maximum compatible version precedes the minimum.
Sourcepub const fn minimum(self) -> CrateVersion
pub const fn minimum(self) -> CrateVersion
Returns the minimum supported crate version.
Sourcepub const fn maximum(self) -> Option<CrateVersion>
pub const fn maximum(self) -> Option<CrateVersion>
Returns the optional maximum supported crate version.
Sourcepub const fn contains(self, version: CrateVersion) -> bool
pub const fn contains(self, version: CrateVersion) -> bool
Returns whether version falls within this inclusive range.
Trait Implementations§
Source§impl Clone for MigrationCompatibility
impl Clone for MigrationCompatibility
Source§fn clone(&self) -> MigrationCompatibility
fn clone(&self) -> MigrationCompatibility
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 moreimpl Copy for MigrationCompatibility
Source§impl Debug for MigrationCompatibility
impl Debug for MigrationCompatibility
impl Eq for MigrationCompatibility
Source§impl PartialEq for MigrationCompatibility
impl PartialEq for MigrationCompatibility
impl StructuralPartialEq for MigrationCompatibility
Auto Trait Implementations§
impl Freeze for MigrationCompatibility
impl RefUnwindSafe for MigrationCompatibility
impl Send for MigrationCompatibility
impl Sync for MigrationCompatibility
impl Unpin for MigrationCompatibility
impl UnsafeUnpin for MigrationCompatibility
impl UnwindSafe for MigrationCompatibility
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§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<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> 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> ⓘ
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 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> ⓘ
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