Safe Haskell | None |
---|---|
Language | Haskell98 |
The RLP module provides a framework within which serializers can be built, described in the Ethereum Yellowpaper (http://gavwood.com/paper.pdf).
The RLPObject
is an intermediate data container, whose serialization rules are well defined. By creating code that converts from a
given type to an RLPObject
, full serialization will be specified. The RLPSerializable
class provides functions to do this conversion.
- data RLPObject
- formatRLPObject :: RLPObject -> String
- class RLPSerializable a where
- rlpSplit :: ByteString -> (RLPObject, ByteString)
- rlpSerialize :: RLPObject -> ByteString
- rlpDeserialize :: ByteString -> RLPObject
Documentation
An internal representation of generic data, with no type information.
End users will not need to directly create objects of this type (an RLPObject
can be created using rlpEncode
),
however the designer of a new type will need to create conversion code by making their type an instance
of the RLPSerializable class.
formatRLPObject :: RLPObject -> String Source #
class RLPSerializable a where Source #
Converts objects to and from RLPObject
s.
rlpSplit :: ByteString -> (RLPObject, ByteString) Source #
rlpSerialize :: RLPObject -> ByteString Source #
Converts RLPObject
s to bytes.
Full serialization of an object can be obtained using rlpSerialize . rlpEncode
.
rlpDeserialize :: ByteString -> RLPObject Source #
Converts bytes to RLPObject
s.
Full deserialization of an object can be obtained using rlpDecode . rlpDeserialize
.