Safe Haskell | None |
---|---|
Language | Haskell2010 |
Convenient interfaces for serialization with protocol buffers.
- class Protoable a where
- type ProtoType a
- msgPut :: (ReflectDescriptor (ProtoType a), Wire (ProtoType a), Protoable a) => a -> ByteString
- msgGet :: (ReflectDescriptor (ProtoType a), Wire (ProtoType a), Protoable a) => ByteString -> Either String (a, ByteString)
Documentation
class Protoable a where Source #
Conversion between Haskell types and their protocol buffer representations.
toProto :: a -> ProtoType a Source #
Convert from a type to its protocol buffer representation.
fromProto :: MonadError String m => ProtoType a -> m a Source #
Convert from a protocol buffer representation.
Protoable a => Protoable [a] Source # | |
(Protoable a, Protoable b) => Protoable (a, b) Source # | |
(Fact m, Reflects k q Double) => Protoable (CT m (RRq k q Double)) Source # | |
(Fact m, Reflects k q Int64) => Protoable (CT m (ZqBasic k q Int64)) Source # | |
(Fact m, Reflects k q Double) => Protoable (RT m (RRq k q Double)) Source # | |
(Fact m, Reflects k q Int64) => Protoable (RT m (ZqBasic k q Int64)) Source # | |
(Fact m, CElt t r, Protoable (UCyc t m D r)) => Protoable (Cyc t m r) Source # | |
Protoable (t m r) => Protoable (UCyc t m D r) Source # | |
msgPut :: (ReflectDescriptor (ProtoType a), Wire (ProtoType a), Protoable a) => a -> ByteString Source #
Serialize a Haskell type to its protocol buffer ByteString
.
msgGet :: (ReflectDescriptor (ProtoType a), Wire (ProtoType a), Protoable a) => ByteString -> Either String (a, ByteString) Source #
Read a protocol buffer ByteString
to a Haskell type.