glitr/path

Types

pub type PathConverter(path_type) {
  PathConverter(
    encoder: fn(path_type) -> List(String),
    decoder: fn(List(String)) -> Result(path_type, Nil),
  )
}

Constructors

  • PathConverter(
      encoder: fn(path_type) -> List(String),
      decoder: fn(List(String)) -> Result(path_type, Nil),
    )
pub type PathType {
  StaticPath
  ComplexPath
}

Constructors

  • StaticPath
  • ComplexPath
pub opaque type RoutePath(path_type)

Functions

pub fn complex_path(converter: PathConverter(a)) -> RoutePath(a)
pub fn decode(
  path: RoutePath(a),
  value: List(String),
) -> Result(a, Nil)
pub fn encode(path: RoutePath(a), value: a) -> List(String)
pub fn get_type(path: RoutePath(a)) -> PathType
pub fn id_path(root: List(String)) -> RoutePath(String)
pub fn static_path(root: List(String)) -> RoutePath(Nil)
Search Document