Struct BoxServiceMatcher
pub struct BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> { /* private fields */ }Expand description
A boxed ServiceMatcher.
This gives dynamic dispatch without constraining the selected value.
Implementations§
§impl<Input, SelectedService, Error, ModifiedInput> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
pub fn new<T>(
matcher: T,
) -> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>where
T: ServiceMatcher<Input, Service = SelectedService, Error = Error, ModifiedInput = ModifiedInput>,
pub fn new<T>(
matcher: T,
) -> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>where
T: ServiceMatcher<Input, Service = SelectedService, Error = Error, ModifiedInput = ModifiedInput>,
Create a boxed matcher from a concrete matcher implementation.
Trait Implementations§
§impl<Input, SelectedService, Error, ModifiedInput> Clone for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> Clone for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
§fn clone(
&self,
) -> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
fn clone( &self, ) -> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<Input, SelectedService, Error, ModifiedInput> Debug for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> Debug for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
§impl<Input, SelectedService, Error, ModifiedInput> ServiceMatcher<Input> for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> ServiceMatcher<Input> for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
§type ModifiedInput = ModifiedInput
type ModifiedInput = ModifiedInput
Input returned by matching functions,
it might be same as the original input but it can also be modified.
§fn match_service(
&self,
input: Input,
) -> impl Future<Output = Result<ServiceMatch<<BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::ModifiedInput, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Service>, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Error>> + Send
fn match_service( &self, input: Input, ) -> impl Future<Output = Result<ServiceMatch<<BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::ModifiedInput, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Service>, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Error>> + Send
Attempt to select a service for
input.§async fn into_match_service(
self,
input: Input,
) -> Result<ServiceMatch<<BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::ModifiedInput, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Service>, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Error>
async fn into_match_service( self, input: Input, ) -> Result<ServiceMatch<<BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::ModifiedInput, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Service>, <BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput> as ServiceMatcher<Input>>::Error>
Attempt to select a service for
input, consuming the matcher. Read more§fn boxed(
self,
) -> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
fn boxed( self, ) -> BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
Box this matcher for dynamic dispatch.
Auto Trait Implementations§
impl<Input, SelectedService, Error, ModifiedInput> Freeze for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> !RefUnwindSafe for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> Send for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> Sync for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> Unpin for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> UnsafeUnpin for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
impl<Input, SelectedService, Error, ModifiedInput> !UnwindSafe for BoxServiceMatcher<Input, SelectedService, Error, ModifiedInput>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Input, T> DynServiceMatcher<Input> for Twhere
T: ServiceMatcher<Input>,
impl<Input, T> DynServiceMatcher<Input> for Twhere
T: ServiceMatcher<Input>,
§type Service = <T as ServiceMatcher<Input>>::Service
type Service = <T as ServiceMatcher<Input>>::Service
The value returned when a match succeeds.
§type Error = <T as ServiceMatcher<Input>>::Error
type Error = <T as ServiceMatcher<Input>>::Error
The error that can happen while evaluating the matcher.
§type ModifiedInput = <T as ServiceMatcher<Input>>::ModifiedInput
type ModifiedInput = <T as ServiceMatcher<Input>>::ModifiedInput
The input after matcher evaluation.
§fn match_service_box(
&self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<ServiceMatch<<T as DynServiceMatcher<Input>>::ModifiedInput, <T as DynServiceMatcher<Input>>::Service>, <T as DynServiceMatcher<Input>>::Error>> + Send + '_>>
fn match_service_box( &self, input: Input, ) -> Pin<Box<dyn Future<Output = Result<ServiceMatch<<T as DynServiceMatcher<Input>>::ModifiedInput, <T as DynServiceMatcher<Input>>::Service>, <T as DynServiceMatcher<Input>>::Error>> + Send + '_>>
Attempt to select a service for
input.§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