#[non_exhaustive]pub struct KvEncryptionMigrationReport {
pub dry_run: bool,
pub scanned: u64,
pub already_encrypted: u64,
pub legacy_v0_found: u64,
pub upgraded_from_legacy: u64,
pub encrypted: u64,
pub vanished: u64,
pub failed: Vec<String>,
}Expand description
Outcome of migrate_kv_to_encrypted.
#[non_exhaustive]: this is a read-only outcome type, not something
a caller builds – only this crate’s own tests construct one (with
..Default::default(), which only compiles from inside the
crate), so a later field addition here can never be a breaking
change for an external caller.
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: boolWhether this run was a dry run (no writes performed).
scanned: u64Total keys examined under the given prefix. Always equal to
already_encrypted + legacy_v0_found + encrypted + vanished + failed.len().
already_encrypted: u64Keys that were already a current-format envelope – left untouched.
legacy_v0_found: u64Keys that were a LEGACY envelope (format version 0 or 1; the name
is historical) that decrypted successfully – counted here whether
or not they were actually rewritten (see upgraded_from_legacy).
A v0 envelope has no AAD binding its plaintext to this specific
record, so this plaintext’s association with this key could not
be cryptographically verified – it is exactly as trustworthy as
it was before migration, no more, no less. A v1 envelope’s AAD
does bind the record key (its decryption just verified that), but
not its own metadata.
upgraded_from_legacy: u64Keys whose legacy (v0 or v1) envelope was actually rewritten under
the current format. Zero unless this was a real (non-dry) run
AND accept_legacy_v0 was true – see
migrate_kv_to_encrypted’s docs for why that flag exists and
what rewriting a v0 envelope does and does not verify.
encrypted: u64Keys that were plaintext (not an envelope at all) and got encrypted (or would have, in a dry run).
vanished: u64Keys that were read but had vanished by the time of the write-back (concurrent deletion) – not an error, just skipped.
failed: Vec<String>Format-version-0 records whose envelope could not be decrypted
under any loaded key (wrong/missing key, or corrupted). Skipped,
not treated as fatal – the rest of the run still completes.
Only v0 envelopes are decrypt-checked by this function –
a current-format (v1) envelope that can’t decrypt (e.g. its key
was rotated out) is not migration’s concern (it’s already in the
target format) and is counted in already_encrypted, not here.
Entries are a safe identifier (see [safe_log_id]), never the
raw storage key – some keys in this crate are themselves bearer
secrets (e.g. api_key:{raw_key}).
Trait Implementations§
Source§impl Clone for KvEncryptionMigrationReport
impl Clone for KvEncryptionMigrationReport
Source§impl Debug for KvEncryptionMigrationReport
impl Debug for KvEncryptionMigrationReport
impl Eq for KvEncryptionMigrationReport
impl StructuralPartialEq for KvEncryptionMigrationReport
Auto Trait Implementations§
impl Freeze for KvEncryptionMigrationReport
impl RefUnwindSafe for KvEncryptionMigrationReport
impl Send for KvEncryptionMigrationReport
impl Sync for KvEncryptionMigrationReport
impl Unpin for KvEncryptionMigrationReport
impl UnsafeUnpin for KvEncryptionMigrationReport
impl UnwindSafe for KvEncryptionMigrationReport
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<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
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> 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