#[non_exhaustive]pub struct MigrationOptions {
pub dry_run: bool,
pub accept_legacy_v0: bool,
pub accept_ttl_loss: bool,
}Expand description
Options for migrate_kv_to_encrypted. A named struct rather than
two adjacent bool parameters, specifically so a caller can’t
transpose them – (false, true) instead of (true, false) would
otherwise silently turn an intended dry run into a real upgrade.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dry_run: boolPreview only; don’t write anything. See
migrate_kv_to_encrypted’s own docs for exactly what a dry run
still does (it attempts every decrypt a real run would, for
accurate reporting).
accept_legacy_v0: boolRequired, together with dry_run: false, to actually rewrite a
format-version-0 envelope to the current format. See
migrate_kv_to_encrypted’s own docs for why this is a separate,
explicit opt-in.
accept_ttl_loss: boolA backend that cannot report KV TTLs (AuthStorage::tracks_kv_ttl
is false) makes a real migration turn every expiring entry into a
permanent one. Such a run is refused unless this is true.
Implementations§
Source§impl MigrationOptions
impl MigrationOptions
Sourcepub fn with_accept_ttl_loss(self, accept_ttl_loss: bool) -> Self
pub fn with_accept_ttl_loss(self, accept_ttl_loss: bool) -> Self
Builder-style setter; see Self::with_dry_run.
Sourcepub fn with_dry_run(self, dry_run: bool) -> Self
pub fn with_dry_run(self, dry_run: bool) -> Self
Builder-style setter. #[non_exhaustive] means MigrationOptions { dry_run: true, ..Default::default() } only compiles inside
this crate – a downstream caller needs let mut o = MigrationOptions::default(); o.dry_run = true; or this method
chain instead: MigrationOptions::default().with_dry_run(true).
Sourcepub fn with_accept_legacy_v0(self, accept_legacy_v0: bool) -> Self
pub fn with_accept_legacy_v0(self, accept_legacy_v0: bool) -> Self
Builder-style setter; see Self::with_dry_run for why this
exists instead of a struct literal.
Trait Implementations§
Source§impl Clone for MigrationOptions
impl Clone for MigrationOptions
impl Copy for MigrationOptions
Source§impl Debug for MigrationOptions
impl Debug for MigrationOptions
Auto Trait Implementations§
impl Freeze for MigrationOptions
impl RefUnwindSafe for MigrationOptions
impl Send for MigrationOptions
impl Sync for MigrationOptions
impl Unpin for MigrationOptions
impl UnsafeUnpin for MigrationOptions
impl UnwindSafe for MigrationOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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