pub struct HttpEndpointWrap { /* private fields */ }Expand description
Discovery metadata attached at boot. The HTTP transport collects every
HttpEndpointWrap at configure time, sorts by priority(), and
folds them around the assembled route (after per-route layers, before
CORS / server header).
The wrap closure receives the container so it can resolve providers it
needs (e.g. a global registry of GuardSpecs).
Implementations§
Source§impl HttpEndpointWrap
impl HttpEndpointWrap
Sourcepub fn new<F>(wrap: F) -> Selfwhere
F: Fn(&Container, BoxEndpoint<'static, Response>) -> BoxEndpoint<'static, Response> + Send + Sync + 'static,
pub fn new<F>(wrap: F) -> Selfwhere
F: Fn(&Container, BoxEndpoint<'static, Response>) -> BoxEndpoint<'static, Response> + Send + Sync + 'static,
Construct from any wrap closure with the default priority
(priority::INTERCEPTORS). Use Self::with_priority when you
need an explicit band — Layer-System globals (guards, filters)
always do so the documented ordering is enforced regardless of
AppBuilder call order.
Sourcepub fn with_priority<F>(priority: i32, wrap: F) -> Selfwhere
F: Fn(&Container, BoxEndpoint<'static, Response>) -> BoxEndpoint<'static, Response> + Send + Sync + 'static,
pub fn with_priority<F>(priority: i32, wrap: F) -> Selfwhere
F: Fn(&Container, BoxEndpoint<'static, Response>) -> BoxEndpoint<'static, Response> + Send + Sync + 'static,
Construct with an explicit priority band. Lower priority is applied first by the transport and therefore ends up innermost in the final endpoint composition.
Sourcepub fn priority(&self) -> i32
pub fn priority(&self) -> i32
Priority band — lower applies first (innermost wrap), higher
applies last (outermost wrap). See priority for the canonical
bands the framework uses.
Sourcepub fn wrap(
&self,
container: &Container,
endpoint: BoxEndpoint<'static, Response>,
) -> BoxEndpoint<'static, Response>
pub fn wrap( &self, container: &Container, endpoint: BoxEndpoint<'static, Response>, ) -> BoxEndpoint<'static, Response>
Apply the wrap to endpoint. Called once per meta at
HttpTransport::configure time.