Struct Interception
pub struct Interception<M, D>(/* private fields */);Available on crate feature
inspect only.Expand description
Share this handle with protocol services and any GUI, TUI, or API controller.
Implementations§
§impl<M, D> Interception<M, D>
impl<M, D> Interception<M, D>
pub fn with_changes(changes: Sender<u64>) -> Interception<M, D>
pub fn with_changes(changes: Sender<u64>) -> Interception<M, D>
Share invalidation with a larger controller while retaining typed content APIs.
pub fn subscribe_changes(&self) -> Receiver<u64>
pub fn get(&self, id: u64) -> Option<Arc<M>>
pub fn entries(&self) -> Vec<(u64, Arc<M>)>
pub fn enqueue_with(
&self,
bytes: usize,
limits: QueueLimits,
make: impl FnOnce(u64) -> M,
) -> Result<Ticket<M, D>, QueueFull>
pub fn enqueue_with( &self, bytes: usize, limits: QueueLimits, make: impl FnOnce(u64) -> M, ) -> Result<Ticket<M, D>, QueueFull>
Reserve admission and assign an ID atomically. The constructor runs only after admission succeeds, under the queue lock, and must not re-enter it.
pub fn enqueue( &self, message: M, bytes: usize, limits: QueueLimits, ) -> Result<Ticket<M, D>, QueueFull>
pub fn resolve_with<E>(
&self,
id: u64,
decide: impl FnOnce(&M) -> Result<D, E>,
) -> Result<bool, E>
pub fn resolve_with<E>( &self, id: u64, decide: impl FnOnce(&M) -> Result<D, E>, ) -> Result<bool, E>
Validate and resolve under the same lock. Exactly one caller can win; failed validation leaves the message pending. The callback cannot re-enter.
pub fn resolve(&self, id: u64, decision: D) -> bool
pub fn release_where(&self, decide: impl FnMut(&M) -> Option<D>)
pub fn release_where(&self, decide: impl FnMut(&M) -> Option<D>)
Release a group of related waits atomically, for example one connection. The callback runs under the queue lock and must not re-enter it.
Trait Implementations§
§impl<M, D> Clone for Interception<M, D>
impl<M, D> Clone for Interception<M, D>
§fn clone(&self) -> Interception<M, D>
fn clone(&self) -> Interception<M, D>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<M, D> Debug for Interception<M, D>
impl<M, D> Debug for Interception<M, D>
§impl<M, D> Default for Interception<M, D>
impl<M, D> Default for Interception<M, D>
§fn default() -> Interception<M, D>
fn default() -> Interception<M, D>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<M, D> !RefUnwindSafe for Interception<M, D>
impl<M, D> !UnwindSafe for Interception<M, D>
impl<M, D> Freeze for Interception<M, D>
impl<M, D> Send for Interception<M, D>
impl<M, D> Sync for Interception<M, D>
impl<M, D> Unpin for Interception<M, D>
impl<M, D> UnsafeUnpin for Interception<M, D>where
Arc<Inner<M, D>>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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>
Wrap the input message
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more