Safe Haskell | None |
---|---|
Language | Haskell2010 |
In order to interoperate with the proto3-wire
library,
we sometimes need an instance of Proto3WireEncoder
.
By using the wrappers in this module, such instances can
be obtained automatically if the type can be turned
into a Schema
.
Synopsis
- newtype ViaToProtoBufTypeRef (ref :: TypeRef snm) t = ViaToProtoBufTypeRef {}
- newtype ViaFromProtoBufTypeRef (ref :: TypeRef snm) t = ViaFromProtoBufTypeRef {}
- class FromProtoBufTypeRef (ref :: TypeRef snm) t where
- fromProtoBufTypeRef :: Proxy ref -> Parser RawMessage t
- class ToProtoBufTypeRef (ref :: TypeRef snm) t where
- toProtoBufTypeRef :: Proxy ref -> t -> MessageBuilder
Documentation
newtype ViaToProtoBufTypeRef (ref :: TypeRef snm) t Source #
Specifies that a type is turned into a Protocol Buffers message by using the schema as intermediate representation.
Instances
ToProtoBufTypeRef ref t => Proto3WireEncoder (ViaToProtoBufTypeRef ref t) Source # | |
Defined in Mu.Adapter.ProtoBuf.Via proto3WireEncode :: ViaToProtoBufTypeRef ref t -> MessageBuilder # proto3WireDecode :: Parser RawMessage (ViaToProtoBufTypeRef ref t) # |
newtype ViaFromProtoBufTypeRef (ref :: TypeRef snm) t Source #
Specifies that a type can be parsed from a Protocol Buffers message by using the schema as intermediate representation.
Instances
FromProtoBufTypeRef ref t => Proto3WireEncoder (ViaFromProtoBufTypeRef ref t) Source # | |
Defined in Mu.Adapter.ProtoBuf.Via proto3WireEncode :: ViaFromProtoBufTypeRef ref t -> MessageBuilder # proto3WireDecode :: Parser RawMessage (ViaFromProtoBufTypeRef ref t) # |
class FromProtoBufTypeRef (ref :: TypeRef snm) t where Source #
Types which can be parsed from a Protocol Buffers message.
fromProtoBufTypeRef :: Proxy ref -> Parser RawMessage t Source #
Instances
(FromProtoBufRegistry r t, IsProtoSchema (MappingRight r last) sty, FromSchema (MappingRight r last) sty t) => FromProtoBufTypeRef ('RegistryRef r t last :: TypeRef snm) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via fromProtoBufTypeRef :: Proxy ('RegistryRef r t last) -> Parser RawMessage t Source # | |
(IsProtoSchema sch sty, FromSchema sch sty t) => FromProtoBufTypeRef ('SchemaRef sch sty :: TypeRef snm) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via fromProtoBufTypeRef :: Proxy ('SchemaRef sch sty) -> Parser RawMessage t Source # |
class ToProtoBufTypeRef (ref :: TypeRef snm) t where Source #
Types which can be turned into a Protocol Buffers message.
toProtoBufTypeRef :: Proxy ref -> t -> MessageBuilder Source #
Instances
(FromProtoBufRegistry r t, IsProtoSchema (MappingRight r last) sty, ToSchema (MappingRight r last) sty t) => ToProtoBufTypeRef ('RegistryRef r t last :: TypeRef snm) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via toProtoBufTypeRef :: Proxy ('RegistryRef r t last) -> t -> MessageBuilder Source # | |
(IsProtoSchema sch sty, ToSchema sch sty t) => ToProtoBufTypeRef ('SchemaRef sch sty :: TypeRef snm) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via toProtoBufTypeRef :: Proxy ('SchemaRef sch sty) -> t -> MessageBuilder Source # |
Orphan instances
Proto3WireEncoder () Source # | |
proto3WireEncode :: () -> MessageBuilder # proto3WireDecode :: Parser RawMessage () # |