Skip to main content

BindableEndpoint

Trait BindableEndpoint 

Source
pub trait BindableEndpoint {
    // Required methods
    fn method() -> Method;
    fn pattern() -> String;
    fn match_fn() -> Box<dyn Fn(&[&str]) -> bool + Send + Sync>;
}
Expand description

Trait providing runtime endpoint metadata for binding.

Required Methods§

Source

fn method() -> Method

Source

fn pattern() -> String

Source

fn match_fn() -> Box<dyn Fn(&[&str]) -> bool + Send + Sync>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<E: Effect, T: BindableEndpoint> BindableEndpoint for Requires<E, T>

Requires<E, T> delegates all endpoint metadata to the inner type T.

This allows bind!() to work with Requires-wrapped endpoints. The Requires wrapper is purely a compile-time marker — at runtime, routing behaves identically to the unwrapped endpoint.

Source§

impl<M, P, Req, Res, Q, Err> BindableEndpoint for Endpoint<M, P, Req, Res, Q, Err>
where M: HttpMethod, P: PathSpec + ExtractPath + Send + 'static, P::Captures: Send,

Implementors§