Safe Haskell | None |
---|---|
Language | Haskell2010 |
Serv.Internal.Server
- class Handling spec where
- encodeBody :: WaiResponse hdrs body => Context -> Response hdrs body -> ServerValue
- verbMatch :: Set Verb -> Method -> Bool
- defaultOptionsResponse :: Set Verb -> ServerValue
Documentation
class Handling spec where Source #
The the core type function responsible for interpreting an Api
into a
functioning Server
. It defines a function handle
defined over all forms
of Api
types which consumes a parallel type defined by the associated
type family Impl
. If api :: Api
then Impl api m
is an "implementation"
of the Api'
s server logic executing in the m
monad. Then, applying
handle
to a value of
results in a Impl
apiServer
which can be
executed as a Application
.
Minimal complete definition
Instances
Handling [k] ([] k) Source # | |
Handling (Api star) (Raw star) Source # | |
(VerbsOf [Method *] methods, HeadersReturnedBy methods, HeadersExpectedOf methods, Handling [Method *] methods) => Handling (Api *) (Endpoint * methods) Source # | |
Handling [Api star] apis => Handling (Api star) (OneOf star apis) Source # | |
(Handling a x, Handling [a] xs) => Handling [a] ((:) a x xs) Source # | |
Handling (Method *) method => Handling (Method *) (CaptureHeaders * headers method) Source # | |
Handling (Method *) method => Handling (Method *) (CaptureQuery * query method) Source # | |
(URIDecode v, Handling (Api *) api) => Handling (Api *) ((:>) * (Seg * n v) api) Source # | |
(HeaderDecode n v, Handling (Api *) api) => Handling (Api *) ((:>) * (Header * n v) api) Source # | |
(Handling (Api *) api, CorsPolicy p) => Handling (Api *) ((:>) * (Cors * p) api) Source # | |
(ReflectName n, KnownSymbol v, Handling (Api star) api) => Handling (Api star) ((:>) star (HeaderAs star n v) api) Source # | |
Handling (Api star) api => Handling (Api star) ((:>) star (Wildcard star) api) Source # | |
(KnownSymbol s, Handling (Api star) api) => Handling (Api star) ((:>) star (Const star s) api) Source # | |
(ReflectVerb verb, WaiResponse headers body) => Handling (Method *) (Method * verb headers body) Source # | |
WaiResponse headers body => Handling (Method *) (Method * GET headers body) Source # |
|
Handling (Method *) method => Handling (Method *) (CaptureBody * ctypes value method) Source # | |
encodeBody :: WaiResponse hdrs body => Context -> Response hdrs body -> ServerValue Source #