pub struct FilterConfig<In = Request<Bytes>, Err = ProximaError> {
pub predicate: Predicate<In, Err>,
pub on_reject: RejectMode,
}Expand description
The predicate-gated pass/reject decision, as config and as the pipe
itself: FilterConfig is both the 1:1 serialisable mirror AND the
SendPipe/Pipe implementor (In -> Result<In, Err>, generic over both
like Predicate) — its two fields are exactly what a decision needs
(the gate, and which error a reject produces), so no separate combinator
carries them, and no separate type is needed to use it at a payload of
the caller’s own: FilterConfig { predicate, on_reject }.and_then(inner)
composes at any In/Err the same way Predicate does. Only
FilterConfig::into_filter/FilterConfig::from_spec stay pinned to
this crate’s HTTP PipeHandle, because PipeFactory’s own signature
is pinned there — not a constraint this module introduces.
Fields§
§predicate: Predicate<In, Err>§on_reject: RejectModeImplementations§
Source§impl FilterConfig<Request<Bytes>, ProximaError>
impl FilterConfig<Request<Bytes>, ProximaError>
Sourcepub fn into_filter(self, inner: PipeHandle) -> PipeHandle
pub fn into_filter(self, inner: PipeHandle) -> PipeHandle
Compose the decision in front of inner and erase — predicate. and_then(inner) in one call, matching every other into_* factory
entry point in this crate (Delay::into_delay, Transform:: into_transform, …).
pub fn from_spec( inner: PipeHandle, value: &Value, ) -> Result<PipeHandle, ProximaError>
Trait Implementations§
Source§impl<In, Err> Clone for FilterConfig<In, Err>
impl<In, Err> Clone for FilterConfig<In, Err>
Source§impl<In, Err> Debug for FilterConfig<In, Err>
impl<In, Err> Debug for FilterConfig<In, Err>
Source§impl<In, Err> Default for FilterConfig<In, Err>
impl<In, Err> Default for FilterConfig<In, Err>
Source§impl<'de, In, Err> Deserialize<'de> for FilterConfig<In, Err>
impl<'de, In, Err> Deserialize<'de> for FilterConfig<In, Err>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<In, Err> PartialEq for FilterConfig<In, Err>
impl<In, Err> PartialEq for FilterConfig<In, Err>
Source§impl<In, Err> SendPipe for FilterConfig<In, Err>
impl<In, Err> SendPipe for FilterConfig<In, Err>
Source§impl<In, Err> Serialize for FilterConfig<In, Err>
impl<In, Err> Serialize for FilterConfig<In, Err>
Source§impl<In, Err> UnpinPipe for FilterConfig<In, Err>
impl<In, Err> UnpinPipe for FilterConfig<In, Err>
Source§impl<In, Err> UnpinSendPipe for FilterConfig<In, Err>
impl<In, Err> UnpinSendPipe for FilterConfig<In, Err>
Auto Trait Implementations§
impl<In, Err> Freeze for FilterConfig<In, Err>
impl<In, Err> RefUnwindSafe for FilterConfig<In, Err>where
Predicate<In, Err>: RefUnwindSafe,
impl<In, Err> Send for FilterConfig<In, Err>
impl<In, Err> Sync for FilterConfig<In, Err>
impl<In, Err> Unpin for FilterConfig<In, Err>
impl<In, Err> UnsafeUnpin for FilterConfig<In, Err>where
Predicate<In, Err>: UnsafeUnpin,
impl<In, Err> UnwindSafe for FilterConfig<In, Err>where
Predicate<In, Err>: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<P> PipeExt for Pwhere
P: Pipe,
impl<P> PipeExt for Pwhere
P: Pipe,
Source§fn and_then<Next>(self, next: Next) -> AndThen<Self, Next>
fn and_then<Next>(self, next: Next) -> AndThen<Self, Next>
self.and_then(next) is AndThen::new(self, next) — reads
left-to-right at the call site.Source§fn fanout(self, other: Self) -> FanOut<Self, AllOrNothing>
fn fanout(self, other: Self) -> FanOut<Self, AllOrNothing>
self and other, all-or-nothing.