wayfinder

Types

pub type PathSegment {
  Literal(val: String)
  Param(name: String)
}

Constructors

  • Literal(val: String)
  • Param(name: String)
pub type Route0(a) {
  Route0(path: List(PathSegment), handler: fn() -> a)
}

Constructors

  • Route0(path: List(PathSegment), handler: fn() -> a)
pub type Route1(a) {
  Route1(path: List(PathSegment), handler: fn(String) -> a)
}

Constructors

  • Route1(path: List(PathSegment), handler: fn(String) -> a)
pub type Route2(a) {
  Route2(
    path: List(PathSegment),
    handler: fn(String, String) -> a,
  )
}

Constructors

  • Route2(path: List(PathSegment), handler: fn(String, String) -> a)
pub type Route3(a) {
  Route3(
    path: List(PathSegment),
    handler: fn(String, String, String) -> a,
  )
}

Constructors

  • Route3(
      path: List(PathSegment),
      handler: fn(String, String, String) -> a,
    )
pub type Route4(a) {
  Route4(
    path: List(PathSegment),
    handler: fn(String, String, String, String) -> a,
  )
}

Constructors

  • Route4(
      path: List(PathSegment),
      handler: fn(String, String, String, String) -> a,
    )
pub type Route5(a) {
  Route5(
    path: List(PathSegment),
    handler: fn(String, String, String, String, String) -> a,
  )
}

Constructors

  • Route5(
      path: List(PathSegment),
      handler: fn(String, String, String, String, String) -> a,
    )
pub type Wrapper(a) {
  Wrapper0(Route0(a))
  Wrapper1(Route1(a))
  Wrapper2(Route2(a))
  Wrapper3(Route3(a))
  Wrapper4(Route4(a))
  Wrapper5(Route5(a))
}

Constructors

  • Wrapper0(Route0(a))
  • Wrapper1(Route1(a))
  • Wrapper2(Route2(a))
  • Wrapper3(Route3(a))
  • Wrapper4(Route4(a))
  • Wrapper5(Route5(a))

Values

pub fn do_validate(
  routes: List(Wrapper(a)),
) -> Result(Nil, String)
pub fn get_params1(
  route: Route1(a),
  segs: List(String),
) -> Result(#(String), Nil)
pub fn get_params2(
  route: Route2(a),
  segs: List(String),
) -> Result(#(String, String), Nil)
pub fn get_params3(
  route: Route3(a),
  segs: List(String),
) -> Result(#(String, String, String), Nil)
pub fn get_params4(
  route: Route4(a),
  segs: List(String),
) -> Result(#(String, String, String, String), Nil)
pub fn get_params5(
  route: Route5(a),
  segs: List(String),
) -> Result(#(String, String, String, String, String), Nil)
pub fn make_route0(path: String, handler: fn() -> a) -> Route0(a)
pub fn make_route1(
  path: String,
  handler: fn(String) -> a,
) -> Route1(a)
pub fn make_route2(
  path: String,
  handler: fn(String, String) -> a,
) -> Route2(a)
pub fn make_route3(
  path: String,
  handler: fn(String, String, String) -> a,
) -> Route3(a)
pub fn make_route4(
  path: String,
  handler: fn(String, String, String, String) -> a,
) -> Route4(a)
pub fn make_route5(
  path: String,
  handler: fn(String, String, String, String, String) -> a,
) -> Route5(a)
pub fn make_wrap0(path: String, handler: fn() -> a) -> Wrapper(a)
pub fn make_wrap1(
  path: String,
  handler: fn(String) -> a,
) -> Wrapper(a)
pub fn make_wrap2(
  path: String,
  handler: fn(String, String) -> a,
) -> Wrapper(a)
pub fn make_wrap3(
  path: String,
  handler: fn(String, String, String) -> a,
) -> Wrapper(a)
pub fn make_wrap4(
  path: String,
  handler: fn(String, String, String, String) -> a,
) -> Wrapper(a)
pub fn make_wrap5(
  path: String,
  handler: fn(String, String, String, String, String) -> a,
) -> Wrapper(a)
pub fn path_to_segments(path: String) -> List(PathSegment)
pub fn route_to_path0(route: Route0(a)) -> String
pub fn route_to_path1(route: Route1(a), p1: String) -> String
pub fn route_to_path2(
  route: Route2(a),
  p1: String,
  p2: String,
) -> String
pub fn route_to_path3(
  route: Route3(a),
  p1: String,
  p2: String,
  p3: String,
) -> String
pub fn route_to_path4(
  route: Route4(a),
  p1: String,
  p2: String,
  p3: String,
  p4: String,
) -> String
pub fn route_to_path5(
  route: Route5(a),
  p1: String,
  p2: String,
  p3: String,
  p4: String,
  p5: String,
) -> String
pub fn segs_to_handler(
  segs: List(String),
  routes: List(Wrapper(a)),
) -> Result(a, Nil)
pub fn segs_to_route(
  routes: List(Wrapper(a)),
  segs: List(String),
) -> Result(Wrapper(a), Nil)
pub fn validate(routes: List(Wrapper(a))) -> Nil
Search Document