pub enum DirectoryError {
Auth(AuthError),
Body(Error),
Malformed,
IdentityMismatch,
VersionConflict,
NotPublished,
Codec(String),
UntrustedSignature,
Unexpected {
status: u16,
},
}Expand description
Everything the device-directory flows can fail with. Callers switch on the typed variant
(or its stable error.* code), never on a bare status.
Variants§
Auth(AuthError)
The authenticated request itself failed (transport, session expiry, refresh).
Body(Error)
Reading the response body off the wire failed.
Malformed
The server rejected the document as malformed (400).
IdentityMismatch
The presented identity key is not the account’s anchored one (403): the
document is well-formed and verifies, but under somebody else’s key.
VersionConflict
The submitted directory_version does not advance the stored one (409, invariant 23 —
the anti-rollback rule). Re-fetch, re-key, and re-publish at a higher version.
NotPublished
No directory has been published for the requested user (404).
Codec(String)
The directory bytes could not be (de)serialized as the canonical DeviceDirectory.
UntrustedSignature
A fetched directory does not verify under the pinned user identity key — a foreign or forged document. Fail-closed: it is never returned to the caller.
Unexpected
The server returned an unmodeled status.
Implementations§
Source§impl DirectoryError
impl DirectoryError
Sourcepub fn error_code(&self) -> Option<&'static str>
pub fn error_code(&self) -> Option<&'static str>
The stable error.* catalog code for this failure, when one applies. Clients localize
the code; the English detail message stays English.
Trait Implementations§
Source§impl Debug for DirectoryError
impl Debug for DirectoryError
Source§impl Display for DirectoryError
impl Display for DirectoryError
Source§impl Error for DirectoryError
impl Error for DirectoryError
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 From<AuthError> for DirectoryError
impl From<AuthError> for DirectoryError
Source§impl From<DirectoryError> for FfiError
impl From<DirectoryError> for FfiError
Source§fn from(err: DirectoryError) -> Self
fn from(err: DirectoryError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for DirectoryError
impl !UnwindSafe for DirectoryError
impl Freeze for DirectoryError
impl Send for DirectoryError
impl Sync for DirectoryError
impl Unpin for DirectoryError
impl UnsafeUnpin for DirectoryError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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