pub enum Choice<L, R> {
Left(L),
Right(R),
}Expand description
One of two hook implementations, chosen when the server is configured: a
local default or a remote adapter. It implements each stage trait both
sides do and forwards Authorizer::is_open and Admission::is_default,
which the pipeline reads (an authority role refuses an open authorizer, and
only the default admission carries the built-in quota).
Variants§
Trait Implementations§
Source§impl<L: Admission, R: Admission> Admission for Choice<L, R>
impl<L: Admission, R: Admission> Admission for Choice<L, R>
Source§fn is_default(&self) -> bool
fn is_default(&self) -> bool
Whether this is the default quota-only admission (D27).
Source§async fn admit(
&self,
input: &AdmissionInput<'_>,
) -> Result<AdmissionDecision, ServerError>
async fn admit( &self, input: &AdmissionInput<'_>, ) -> Result<AdmissionDecision, ServerError>
Decide whether a new write may proceed. Read more
Source§impl<L: Authorizer, R: Authorizer> Authorizer for Choice<L, R>
impl<L: Authorizer, R: Authorizer> Authorizer for Choice<L, R>
Source§impl<L: OutcomeSink, R: OutcomeSink> OutcomeSink for Choice<L, R>
impl<L: OutcomeSink, R: OutcomeSink> OutcomeSink for Choice<L, R>
Source§async fn deliver(&self, outcome: &Outcome) -> Result<(), DeliveryError>
async fn deliver(&self, outcome: &Outcome) -> Result<(), DeliveryError>
Deliver one terminal outcome. Every error leaves it queued for retry.
Source§async fn deliver_batch(
&self,
outcomes: &[Outcome],
) -> Vec<Result<(), DeliveryError>>
async fn deliver_batch( &self, outcomes: &[Outcome], ) -> Vec<Result<(), DeliveryError>>
Deliver a batch sequentially by default; each result is independent.
Auto Trait Implementations§
impl<L, R> Freeze for Choice<L, R>
impl<L, R> RefUnwindSafe for Choice<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Choice<L, R>
impl<L, R> Sync for Choice<L, R>
impl<L, R> Unpin for Choice<L, R>
impl<L, R> UnsafeUnpin for Choice<L, R>where
L: UnsafeUnpin,
R: UnsafeUnpin,
impl<L, R> UnwindSafe for Choice<L, R>where
L: UnwindSafe,
R: 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