proute/discover
Types
pub type DiscoverError {
PagesDirectoryUnreadable(path: String)
MissingNotFound(mount_name: String, pages: String)
UnsupportedCatchAll(source_file: String)
InvalidPageModulePath(source_file: String)
InvalidPageSegment(source_file: String, segment: String)
InvalidRouteParam(source_file: String, param: String)
DuplicateRouteParam(source_file: String, param: String)
InvalidConstructor(source_file: String, constructor: String)
DuplicatePath(
path: String,
first_file: String,
second_file: String,
)
DuplicateConstructor(
constructor: String,
first_file: String,
second_file: String,
)
DuplicateHelper(
helper: String,
first_file: String,
second_file: String,
)
}
Constructors
-
PagesDirectoryUnreadable(path: String) -
MissingNotFound(mount_name: String, pages: String) -
UnsupportedCatchAll(source_file: String) -
InvalidPageModulePath(source_file: String) -
InvalidPageSegment(source_file: String, segment: String) -
InvalidRouteParam(source_file: String, param: String) -
DuplicateRouteParam(source_file: String, param: String) -
InvalidConstructor(source_file: String, constructor: String) -
DuplicatePath( path: String, first_file: String, second_file: String, ) -
DuplicateConstructor( constructor: String, first_file: String, second_file: String, ) -
DuplicateHelper( helper: String, first_file: String, second_file: String, )
pub type MountRoutes {
MountRoutes(mount: config.Mount, routes: List(PageRoute))
}
Constructors
-
MountRoutes(mount: config.Mount, routes: List(PageRoute))
pub type PageRoute {
PageRoute(
kind: RouteKind,
constructor: String,
path: String,
segments: List(RouteSegment),
params: List(RouteParam),
source_file: String,
page_module: String,
)
}
Constructors
-
PageRoute( kind: RouteKind, constructor: String, path: String, segments: List(RouteSegment), params: List(RouteParam), source_file: String, page_module: String, )
pub type RouteKind {
Home
NotFound
Static
Dynamic
}
Constructors
-
Home -
NotFound -
Static -
Dynamic
pub type RouteParam {
RouteParam(name: String, type_: String)
}
Constructors
-
RouteParam(name: String, type_: String)
pub type RouteSegment {
StaticSegment(value: String)
DynamicSegment(name: String)
}
Constructors
-
StaticSegment(value: String) -
DynamicSegment(name: String)
Values
pub fn describe_error(error: DiscoverError) -> String
pub fn discover_mount(
mount: config.Mount,
) -> Result(MountRoutes, DiscoverError)
pub fn page_module_path(source_file: String) -> String