router

Types

pub type Router {
  Router(
    routes: dict.Dict(
      route.Route,
      handler.Handler(BitArray, bytes_builder.BytesBuilder),
    ),
  )
}

Constructors

  • Router(
      routes: dict.Dict(
        route.Route,
        handler.Handler(BitArray, bytes_builder.BytesBuilder),
      ),
    )

Functions

pub fn add(
  router: Router,
  method: Method,
  path: String,
  handler: fn(Request(BitArray)) -> Response(BytesBuilder),
) -> Router
pub fn get_handler(
  router: Router,
) -> fn(Request(BitArray)) -> Response(BytesBuilder)
pub fn new() -> Router
Search Document