servant-server-0.20.3.0: A family of combinators for defining webservices APIs and serving them

Safe Haskell | None
Language | Haskell2010

Servant.Server.Internal.ResponseRender

# Documentation

class Typeable a => IsWaiBody a where Source #

Methods

responseToWai :: InternalResponse a -> Response Source #

#### Instances

Instances details

IsWaiBody ByteString Source # |
Instance details Defined in Servant.Server.Internal.ResponseRender Methods responseToWai :: InternalResponse ByteString -> Response Source #
IsWaiBody () Source # |
Instance details Defined in Servant.Server.Internal.ResponseRender Methods responseToWai :: InternalResponse () -> Response Source #
IsWaiBody (SourceIO ByteString) Source # |
Instance details Defined in Servant.Server.Internal.ResponseRender Methods responseToWai :: InternalResponse (SourceIO ByteString) -> Response Source #

data SomeResponse Source #

Constructors

IsWaiBody a => SomeResponse (InternalResponse a) |

class ResponseListRender (cs :: k) (as :: [Type]) where Source #

Methods

responseListRender :: AcceptHeader -> Union (ResponseTypes as) -> Maybe SomeResponse Source #

responseListStatuses :: [Status] Source #

#### Instances

Instances details

ResponseListRender (cs :: k) ('[] :: [Type]) Source # |
Instance details Defined in Servant.Server.Internal.ResponseRender Methods responseListRender :: AcceptHeader -> Union (ResponseTypes ('[] :: [Type])) -> Maybe SomeResponse Source # responseListStatuses :: [Status] Source #
(ResponseRender cs a, ResponseListRender cs as, KnownStatus (ResponseStatus a)) => ResponseListRender (cs :: k) (a ': as) Source # |
Instance details Defined in Servant.Server.Internal.ResponseRender Methods responseListRender :: AcceptHeader -> Union (ResponseTypes (a ': as)) -> Maybe SomeResponse Source # responseListStatuses :: [Status] Source #

class IsWaiBody (ResponseBody a) => ResponseRender (cs :: k) a where Source #

Associated Types

type ResponseStatus a :: Nat Source #

type ResponseBody a Source #

Methods

responseRender :: AcceptHeader -> ResponseType a -> Maybe (InternalResponse (ResponseBody a)) Source #

#### Instances

Instances details

(AsHeaders xs (ResponseType r) a, ServantHeaders hs xs, ResponseRender cs r) => ResponseRender (cs :: k) (WithHeaders hs a r) Source # |

Instance details

Defined in Servant.Server.Internal.ResponseRender

Associated Types

type ResponseStatus (WithHeaders hs a r) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseStatus (WithHeaders hs a r) = ResponseStatus r
type ResponseBody (WithHeaders hs a r) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseBody (WithHeaders hs a r) = ResponseBody r

Methods

responseRender :: AcceptHeader -> ResponseType (WithHeaders hs a r) -> Maybe (InternalResponse (ResponseBody (WithHeaders hs a r))) Source #

(Accept ct, KnownStatus s) => ResponseRender (cs :: k) (RespondStreaming s desc framing ct) Source # |

Instance details

Defined in Servant.Server.Internal.ResponseRender

Associated Types

type ResponseStatus (RespondStreaming s desc framing ct) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseStatus (RespondStreaming s desc framing ct) = s
type ResponseBody (RespondStreaming s desc framing ct) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseBody (RespondStreaming s desc framing ct) = SourceIO ByteString

Methods

responseRender :: AcceptHeader -> ResponseType (RespondStreaming s desc framing ct) -> Maybe (InternalResponse (ResponseBody (RespondStreaming s desc framing ct))) Source #

KnownStatus s => ResponseRender (cs :: k) (RespondAs '() s desc ()) Source # |

Instance details

Defined in Servant.Server.Internal.ResponseRender

Associated Types

type ResponseStatus (RespondAs '() s desc ()) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseStatus (RespondAs '() s desc ()) = s
type ResponseBody (RespondAs '() s desc ()) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseBody (RespondAs '() s desc ()) = ()

Methods

responseRender :: AcceptHeader -> ResponseType (RespondAs '() s desc ()) -> Maybe (InternalResponse (ResponseBody (RespondAs '() s desc ()))) Source #

(KnownStatus s, MimeRender ct a) => ResponseRender (cs :: k) (RespondAs ct s desc a) Source # |

Instance details

Defined in Servant.Server.Internal.ResponseRender

Associated Types

type ResponseStatus (RespondAs ct s desc a) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseStatus (RespondAs ct s desc a) = s
type ResponseBody (RespondAs ct s desc a) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseBody (RespondAs ct s desc a) = ByteString

Methods

responseRender :: AcceptHeader -> ResponseType (RespondAs ct s desc a) -> Maybe (InternalResponse (ResponseBody (RespondAs ct s desc a))) Source #

(AllMimeRender cs a, KnownStatus s) => ResponseRender (cs :: [Type]) (Respond s desc a) Source # |

Instance details

Defined in Servant.Server.Internal.ResponseRender

Associated Types

type ResponseStatus (Respond s desc a) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseStatus (Respond s desc a) = s
type ResponseBody (Respond s desc a) |
Instance details Defined in Servant.Server.Internal.ResponseRender type ResponseBody (Respond s desc a) = ByteString

Methods

responseRender :: AcceptHeader -> ResponseType (Respond s desc a) -> Maybe (InternalResponse (ResponseBody (Respond s desc a))) Source #

addContentType :: forall {k} (ct :: k) a. Accept ct => InternalResponse a -> InternalResponse a Source #

addContentType' :: MediaType -> InternalResponse a -> InternalResponse a Source #

setEmptyBody :: SomeResponse -> SomeResponse Source #

someResponseToWai :: SomeResponse -> Response Source #