#[non_exhaustive]pub enum AuthplaneError {
Auth(AuthError),
ConsentRequired(Box<ConsentRequiredError>),
CircuitOpen,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auth(AuthError)
ConsentRequired(Box<ConsentRequiredError>)
The payload is boxed. ConsentRequiredError carries six fields
(128 bytes) against AuthError’s three (56), so leaving it inline
makes every Result<_, AuthplaneError> in the crate — overwhelmingly
the success path — as wide as the rarest error. Boxing keeps the enum
at 64 bytes.
Construct with AuthplaneError::from(consent) or consent.into();
match arms bind a Box<ConsentRequiredError> and reach the fields
through Deref, so patterns need no change.
CircuitOpen
Circuit breaker is open — the authorization server is considered unavailable.
Implementations§
Source§impl AuthplaneError
Convenience predicates on AuthplaneError for common error categories.
impl AuthplaneError
Convenience predicates on AuthplaneError for common error categories.
pub fn is_circuit_open(&self) -> bool
pub fn is_consent_required(&self) -> bool
Trait Implementations§
Source§impl Clone for AuthplaneError
impl Clone for AuthplaneError
Source§impl Debug for AuthplaneError
impl Debug for AuthplaneError
Source§impl Display for AuthplaneError
impl Display for AuthplaneError
impl Eq for AuthplaneError
Source§impl Error for AuthplaneError
impl Error for AuthplaneError
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 AuthplaneError
impl From<AuthError> for AuthplaneError
Source§impl From<Box<ConsentRequiredError>> for AuthplaneError
impl From<Box<ConsentRequiredError>> for AuthplaneError
Source§fn from(source: Box<ConsentRequiredError>) -> Self
fn from(source: Box<ConsentRequiredError>) -> Self
Source§impl From<ConsentRequiredError> for AuthplaneError
Boxing companion for the derived From<Box<ConsentRequiredError>>, so
call sites and ? keep converting an unboxed ConsentRequiredError.
impl From<ConsentRequiredError> for AuthplaneError
Boxing companion for the derived From<Box<ConsentRequiredError>>, so
call sites and ? keep converting an unboxed ConsentRequiredError.
Source§fn from(error: ConsentRequiredError) -> Self
fn from(error: ConsentRequiredError) -> Self
Source§impl PartialEq for AuthplaneError
impl PartialEq for AuthplaneError
impl StructuralPartialEq for AuthplaneError
Auto Trait Implementations§
impl Freeze for AuthplaneError
impl RefUnwindSafe for AuthplaneError
impl Send for AuthplaneError
impl Sync for AuthplaneError
impl Unpin for AuthplaneError
impl UnsafeUnpin for AuthplaneError
impl UnwindSafe for AuthplaneError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.