pub struct ApprovalGate { /* private fields */ }Expand description
Who may approve, checked before a decision reaches the executor.
Implementations§
Source§impl ApprovalGate
impl ApprovalGate
Sourcepub const fn new() -> ApprovalGate
pub const fn new() -> ApprovalGate
Any authenticated caller may approve, except the one whose run asked.
Sourcepub const fn with_review_grants(self) -> ApprovalGate
pub const fn with_review_grants(self) -> ApprovalGate
Lets each caller named by with_approvers reach
a task waiting for their decision, and nothing else of the requester’s,
when tasks are isolated by caller; see the module. The caller
names the requester in REVIEW_FOR_HEADER. Off by default.
Needs an explicit approver list, which build() insists on: a grant to
every authenticated caller is not narrow. It also lets a quorum above 1
be met under isolation, which is otherwise refused.
Sourcepub const fn with_quorum(self, n: usize) -> ApprovalGate
pub const fn with_quorum(self, n: usize) -> ApprovalGate
Waits for n distinct approvers to approve the same request before
the decision reaches the executor; see the module for who
counts and what a deny does. 1, the default, admits the first
approver’s decision. 0 approves nothing and is refused when the
handler is built, as is a quorum larger than the
with_approvers list.
Sourcepub fn with_approvers<I, S>(self, approvers: I) -> ApprovalGate
pub fn with_approvers<I, S>(self, approvers: I) -> ApprovalGate
Only these caller identities may approve, as authentication names
them: caller_id builds the bundled
interceptors’ jwt:<issuer>:<sub>, bearer:<label> and
api-key:<label>. A bare sub or label matches no caller those
interceptors authenticated.
Sourcepub const fn allowing_self_approval(self) -> ApprovalGate
pub const fn allowing_self_approval(self) -> ApprovalGate
Lets the caller whose run asked approve it too. Off by default: the point of asking is usually a second pair of eyes.
Trait Implementations§
Source§impl Clone for ApprovalGate
impl Clone for ApprovalGate
Source§fn clone(&self) -> ApprovalGate
fn clone(&self) -> ApprovalGate
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 ApprovalGate
impl Debug for ApprovalGate
Source§impl Default for ApprovalGate
impl Default for ApprovalGate
Source§fn default() -> ApprovalGate
fn default() -> ApprovalGate
Auto Trait Implementations§
impl Forget for ApprovalGate
impl Freeze for ApprovalGate
impl Move for ApprovalGate
impl RefUnwindSafe for ApprovalGate
impl Send for ApprovalGate
impl Sync for ApprovalGate
impl Unpin for ApprovalGate
impl UnsafeUnpin for ApprovalGate
impl UnwindSafe for ApprovalGate
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].