bond-haskell-0.1.4.1: Runtime support for BOND serialization

Safe HaskellNone
LanguageHaskell2010

Data.Bond.Proto

Synopsis

Documentation

class BondProto t where Source #

Typeclass for Bond serialization protocols.

Methods

bondRead :: BondStruct a => t -> ByteString -> Either String a Source #

Deserialize structure from stream.

bondWrite :: BondStruct a => t -> a -> Either String ByteString Source #

Serialize structure to stream.

bondReadWithSchema :: t -> StructSchema -> ByteString -> Either String Struct Source #

Deserialize structure from stream using provided schema.

bondWriteWithSchema :: t -> StructSchema -> Struct -> Either String ByteString Source #

Serialize structure to stream using provided schema.

bondMarshal :: BondStruct a => t -> a -> Either String ByteString Source #

Serialize structure to stream and add protocol header. See bondUnmarshal for deserialization.

bondMarshalWithSchema :: t -> StructSchema -> Struct -> Either String ByteString Source #

Serialize structure to stream using provided schema and add protocol header. See bondUnmarshalWithSchema for deserialization.

protoSig :: t -> ByteString Source #

Get protocol header.

Instances

BondProto CompactBinaryV1Proto Source # 
BondProto CompactBinaryProto Source # 
BondProto FastBinaryProto Source # 
BondProto JsonProto Source # 
BondProto SimpleBinaryV1Proto Source # 
BondProto SimpleBinaryProto Source # 

class BondProto t => BondTaggedProto t where Source #

Typeclass for tagged Bond serialization protocols. Such protocols support schemaless operations.

Minimal complete definition

bondReadTagged, bondWriteTagged

Methods

bondReadTagged :: t -> ByteString -> Either String Struct Source #

Deserialize structure from stream without schema.

bondWriteTagged :: t -> Struct -> Either String ByteString Source #

Serialize structure to stream without schema.

bondMarshalTagged :: t -> Struct -> Either String ByteString Source #

Serialize structure to stream without schema and add protocol header. See bondUnmarshalTagged for deserialization.