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) t = ViaToProtoBufTypeRef {}
- newtype ViaFromProtoBufTypeRef (ref :: TypeRef) t = ViaFromProtoBufTypeRef {}
- class FromProtoBufTypeRef (ref :: TypeRef) t where
- fromProtoBufTypeRef :: Proxy ref -> Parser RawMessage t
- class ToProtoBufTypeRef (ref :: TypeRef) t where
- toProtoBufTypeRef :: Proxy ref -> t -> MessageBuilder
Documentation
newtype ViaToProtoBufTypeRef (ref :: TypeRef) 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) 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) 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 Maybe (MappingRight r last) sty, FromSchema Maybe (MappingRight r last) sty t) => FromProtoBufTypeRef (ViaRegistry r t last) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via fromProtoBufTypeRef :: Proxy (ViaRegistry r t last) -> Parser RawMessage t Source # | |
(IsProtoSchema Maybe sch sty, FromSchema Maybe sch sty t) => FromProtoBufTypeRef (ViaSchema sch sty) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via fromProtoBufTypeRef :: Proxy (ViaSchema sch sty) -> Parser RawMessage t Source # |
class ToProtoBufTypeRef (ref :: TypeRef) t where Source #
Types which can be turned into a Protocol Buffers message.
toProtoBufTypeRef :: Proxy ref -> t -> MessageBuilder Source #
Instances
(FromProtoBufRegistry r t, IsProtoSchema Maybe (MappingRight r last) sty, ToSchema Maybe (MappingRight r last) sty t) => ToProtoBufTypeRef (ViaRegistry r t last) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via toProtoBufTypeRef :: Proxy (ViaRegistry r t last) -> t -> MessageBuilder Source # | |
(IsProtoSchema Maybe sch sty, ToSchema Maybe sch sty t) => ToProtoBufTypeRef (ViaSchema sch sty) t Source # | |
Defined in Mu.Adapter.ProtoBuf.Via toProtoBufTypeRef :: Proxy (ViaSchema sch sty) -> t -> MessageBuilder Source # |
Orphan instances
Proto3WireEncoder () Source # | |
proto3WireEncode :: () -> MessageBuilder # proto3WireDecode :: Parser RawMessage () # |