| Copyright | (c) digitally induced GmbH 2020 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.Router.Types
Description
Synopsis
- data ControllerRoute application
- = ControllerRouteMap !(HashMap ByteString (application -> Application)) (Parser Application)
- | ControllerRouteParser !(Parser Application)
- data TypedAutoRouteError
- = BadType {
- expectedType :: !ByteString
- value :: !(Maybe ByteString)
- field :: !ByteString
- | TooFewArguments
- | NotMatched
- | NoConstructorMatched {
- expectedType :: !ByteString
- value :: !(Maybe ByteString)
- field :: !ByteString
- = BadType {
- data UnexpectedMethodException = UnexpectedMethodException {
- allowedMethods :: [StdMethod]
- method :: StdMethod
Documentation
data ControllerRoute application Source #
A controller route entry — either a pre-built HashMap for O(1) dispatch, or a custom Attoparsec parser for dynamic URL patterns.
ControllerRouteMap carries both an auto-route HashMap and a fallback parser
for custom routes. ControllerRouteParser wraps standalone parsers like get, post,
webSocketApp, startPage, etc.
frontControllerToWAIApp scans all ControllerRouteMap HashMaps directly (no Attoparsec)
for O(1) dispatch, and only falls back to Attoparsec for custom/dynamic route parsers.
Constructors
| ControllerRouteMap !(HashMap ByteString (application -> Application)) (Parser Application) | Auto-route HashMap + custom routes fallback parser (lazy — only evaluated on HashMap miss) |
| ControllerRouteParser !(Parser Application) | Custom route parser (for get, post, webSocketApp, startPage, etc.) |
data TypedAutoRouteError Source #
Constructors
| BadType | |
Fields
| |
| TooFewArguments | |
| NotMatched | |
| NoConstructorMatched | Thrown when Let's say we have a When opening |
Fields
| |
Instances
| Exception TypedAutoRouteError Source # | |
Defined in IHP.Router.Types | |
| Show TypedAutoRouteError Source # | |
Defined in IHP.Router.Types Methods showsPrec :: Int -> TypedAutoRouteError -> ShowS # show :: TypedAutoRouteError -> String # showList :: [TypedAutoRouteError] -> ShowS # | |
data UnexpectedMethodException Source #
Thrown e.g. a CreateProjectAction is called from a GET request
Constructors
| UnexpectedMethodException | |
Fields
| |
Instances
| Exception UnexpectedMethodException Source # | |
Defined in IHP.Router.Types | |
| Show UnexpectedMethodException Source # | |
Defined in IHP.Router.Types Methods showsPrec :: Int -> UnexpectedMethodException -> ShowS # show :: UnexpectedMethodException -> String # showList :: [UnexpectedMethodException] -> ShowS # | |