pub struct FallbackJudgment<P, F> { /* private fields */ }Expand description
A judgment backend that tries a primary backend first and falls back to a second backend when the primary fails in a way the fallback can fix.
Both backends answer through the shared JudgmentError taxonomy, so the
decision of whether to fall back is one match over P’s error, not a
per-backend special case.
Implementations§
Trait Implementations§
Source§impl<P, F> JudgmentProvider for FallbackJudgment<P, F>
impl<P, F> JudgmentProvider for FallbackJudgment<P, F>
Source§type Error = JudgmentError
type Error = JudgmentError
The backend’s concrete error type.
Source§fn judge<'life0, 'async_trait>(
&'life0 self,
request: JudgmentRequest,
) -> Pin<Box<dyn Future<Output = Result<JudgmentResponse, JudgmentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn judge<'life0, 'async_trait>(
&'life0 self,
request: JudgmentRequest,
) -> Pin<Box<dyn Future<Output = Result<JudgmentResponse, JudgmentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Answers every question in
request over its state. Read moreAuto Trait Implementations§
impl<P, F> Freeze for FallbackJudgment<P, F>
impl<P, F> RefUnwindSafe for FallbackJudgment<P, F>where
P: RefUnwindSafe,
F: RefUnwindSafe,
impl<P, F> Send for FallbackJudgment<P, F>
impl<P, F> Sync for FallbackJudgment<P, F>
impl<P, F> Unpin for FallbackJudgment<P, F>
impl<P, F> UnsafeUnpin for FallbackJudgment<P, F>where
P: UnsafeUnpin,
F: UnsafeUnpin,
impl<P, F> UnwindSafe for FallbackJudgment<P, F>where
P: UnwindSafe,
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more