#[non_exhaustive]pub enum ProtocolStateError {
NotFound(String),
Corrupted(String),
StoreFailed(String),
LoadFailed(String),
DeleteFailed(String),
}Expand description
Failure of a protocol-state storage operation.
Deliberately defined here rather than reusing
offline_protocol_mls::StorageError: the whole point of this trait is that
install-scoped delivery state does not share a contract — or a crate — with
cryptographic storage. Implementations map their platform errors onto these
variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound(String)
The requested entry does not exist.
Ok(None) from ProtocolStateStorage::load is the preferred way to
report absence; this variant exists for implementations whose platform
API cannot express it any other way. The SDK reads the two identically —
a load that fails with NotFound is absence, not a lost record — so
an implementation that reports absence this way does not cause
spurious message_failed settlements on restore.
Corrupted(String)
The entry exists but can never be decoded by the backing store.
This is the variant for a permanent loss the implementation detected
itself — a truncated or tampered record, a framing header that does not
parse, an entry over
MAX_PROTOCOL_STATE_RECORD_TRANSFER_BYTES. The SDK reads it as
exactly that: the record is dropped and, for categories the application
holds message ids for, settled with a terminal message_failed (or a
pending_state_lost diagnostic) so the id cannot hang forever.
Report it only when the record can never be read. Every other error variant means “this read failed”, which the SDK treats as recoverable: the record is left in place for a later launch and nothing is settled. Reporting a transient failure here would tell the application a message failed terminally and then deliver it on the next launch.
Returning Ok(None) for a record the implementation destroyed is
accepted — the built-in providers did that before this variant carried
meaning — but it costs the settlement: the SDK cannot distinguish it
from a record that was never written, so the application is told
nothing at all.
StoreFailed(String)
The entry could not be written.
LoadFailed(String)
The entry could not be read.
DeleteFailed(String)
The entry could not be removed.
Trait Implementations§
Source§impl Clone for ProtocolStateError
impl Clone for ProtocolStateError
Source§fn clone(&self) -> ProtocolStateError
fn clone(&self) -> ProtocolStateError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolStateError
impl Debug for ProtocolStateError
Source§impl Display for ProtocolStateError
impl Display for ProtocolStateError
impl Eq for ProtocolStateError
Source§impl Error for ProtocolStateError
impl Error for ProtocolStateError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ProtocolStateError
impl PartialEq for ProtocolStateError
impl StructuralPartialEq for ProtocolStateError
Auto Trait Implementations§
impl Freeze for ProtocolStateError
impl RefUnwindSafe for ProtocolStateError
impl Send for ProtocolStateError
impl Sync for ProtocolStateError
impl Unpin for ProtocolStateError
impl UnsafeUnpin for ProtocolStateError
impl UnwindSafe for ProtocolStateError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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