[−][src]Struct saphir::controller::EndpointsBuilder
Builder to simplify returning a list of endpoint in the handlers
method of
the controller trait
Implementations
impl<C: Controller> EndpointsBuilder<C>
[src]
pub fn new() -> Self
[src]
Create a new endpoint builder
pub fn add<H>(self, method: Method, route: &'static str, handler: H) -> Self where
H: 'static + DynControllerHandler<C, Body> + Send + Sync,
[src]
H: 'static + DynControllerHandler<C, Body> + Send + Sync,
Add a endpoint the the builder
impl BasicController { async fn healthz(&self, req: Request<Body>) -> impl Responder {200} } let b: EndpointsBuilder<BasicController> = EndpointsBuilder::new().add(Method::GET, "/healthz", BasicController::healthz);
pub fn add_with_guards<H, F, Chain>(
self,
method: Method,
route: &'static str,
handler: H,
guards: F
) -> Self where
H: 'static + DynControllerHandler<C, Body> + Send + Sync,
F: FnOnce(GuardBuilder<GuardChainEnd>) -> GuardBuilder<Chain>,
Chain: GuardChain + 'static,
[src]
self,
method: Method,
route: &'static str,
handler: H,
guards: F
) -> Self where
H: 'static + DynControllerHandler<C, Body> + Send + Sync,
F: FnOnce(GuardBuilder<GuardChainEnd>) -> GuardBuilder<Chain>,
Chain: GuardChain + 'static,
Add a guarded endpoint the the builder
pub fn build(self) -> Vec<ControllerEndpoint<C>>
[src]
Finish the builder into a Vec<ControllerEndpoint<C>>
Trait Implementations
impl<C: Default + Controller> Default for EndpointsBuilder<C>
[src]
fn default() -> EndpointsBuilder<C>
[src]
Auto Trait Implementations
impl<C> !RefUnwindSafe for EndpointsBuilder<C>
impl<C> Send for EndpointsBuilder<C>
impl<C> Sync for EndpointsBuilder<C>
impl<C> Unpin for EndpointsBuilder<C>
impl<C> !UnwindSafe for EndpointsBuilder<C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,