Struct hyper_simple_server::RoutesBuilder[][src]

pub struct RoutesBuilder {
    pub routes: Vec<Arc<Route>>,
}

Fields

routes: Vec<Arc<Route>>

Implementations

impl RoutesBuilder[src]

pub fn new() -> Self[src]

pub fn build(self) -> ServerResult<Routes>[src]

pub fn with_route<'a, P, H, F, RB>(self, _paths: P, _handler: H) -> Self where
    P: Into<RoutePaths<'a>>,
    H: Handler<Future = F, ResponseBody = RB, ResponseBodyError = RB::Error> + Send + Sync + 'static,
    F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
    RB: BodyTrait<Data = Bytes> + Send + 'static,
    RB::Error: Error + Send + Sync + 'static, 
[src]

pub fn with_route_fn_sync<'a, P, I, C, RB>(self, _paths: P, _handler: I) -> Self where
    P: Into<RoutePaths<'a>>,
    I: Into<HandlerFnSync<C, RB>>,
    C: Fn(Request<Body>) -> ServerResult<Response<RB>> + Send + Sync + 'static,
    RB: BodyTrait<Data = Bytes> + Send + 'static,
    RB::Error: Error + Send + Sync + 'static, 
[src]

pub fn with_route_fn_async<'a, P, I, C, F, RB>(
    self,
    _paths: P,
    _handler: I
) -> Self where
    P: Into<RoutePaths<'a>>,
    I: Into<HandlerFnAsync<C, F, RB>>,
    C: Fn(Request<Body>) -> F + Send + Sync + 'static,
    F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
    RB: BodyTrait<Data = Bytes> + Send + 'static,
    RB::Error: Error + Send + Sync + 'static, 
[src]

pub fn with_route_dyn<'a, P, H>(self, _paths: P, _handler: H) -> Self where
    H: HandlerDyn,
    P: Into<RoutePaths<'a>>, 
[src]

pub fn with_route_arc<'a, P, I>(mut self: Self, _paths: P, _handler: I) -> Self where
    I: Into<HandlerDynArc>,
    P: Into<RoutePaths<'a>>, 
[src]

pub fn with_route_object(mut self: Self, _route: Route) -> Self[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.