Text.ProtocolBuffers.Unknown
Description
This module add unknown field supprt to the library
This should support 1) Storing unknown bytestrings in messages a) Mergeable b) Default c) Show 2) loading the unknown bytestrings into a (Map FieldId) from wire a) If wiretypes differ this is an error so report it b) Take extra care to ensure a _copy_ of the input is kept (?) 3) save unknown bytestring back to the wire 4) API ? a) Provide ability to wireGet the data as a real type b) clear the data c) has any unkown data ? 5) Extend reflection to indicate presence of support for unkown data 6) Extend Options and command line to flag this 7) Extend hprotoc to add in this field
- newtype UnknownField = UnknownField (Map FieldId UnknownFieldValue)
- class UnknownMessage msg where
- getUnknownField :: msg -> UnknownField
- putUnknownField :: UnknownField -> msg -> msg
- data UnknownFieldValue = UFV !WireType !(Seq ByteString)
- wireSizeUnknownField :: UnknownField -> WireSize
- wirePutUnknownField :: UnknownField -> Put
- loadUnknown :: (Typeable a, UnknownMessage a) => FieldId -> WireType -> a -> Get a
Documentation
newtype UnknownField Source
Constructors
UnknownField (Map FieldId UnknownFieldValue) |
class UnknownMessage msg whereSource
Methods
getUnknownField :: msg -> UnknownFieldSource
putUnknownField :: UnknownField -> msg -> msgSource
data UnknownFieldValue Source
Constructors
UFV !WireType !(Seq ByteString) |
wireSizeUnknownField :: UnknownField -> WireSizeSource
This is used by the generated code
wirePutUnknownField :: UnknownField -> PutSource
This is used by the generated code
loadUnknown :: (Typeable a, UnknownMessage a) => FieldId -> WireType -> a -> Get aSource