| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Network.LibP2P.MultistreamSelect.Wire
Description
Wire format for multistream-select.
Every message is: varint-lengthpayloadn The length includes the trailing newline byte.
Synopsis
- encodeMessage :: Text -> ByteString
- decodeMessage :: ByteString -> Either String (Text, ByteString)
- multistreamHeader :: Text
- naMessage :: Text
Documentation
encodeMessage :: Text -> ByteString Source #
Encode a multistream-select message (protocol ID or command). Produces: varint(len+1)encoded text0x0a
decodeMessage :: ByteString -> Either String (Text, ByteString) Source #
Decode a multistream-select message from bytes. Returns the text content (without newline) and remaining bytes.
multistreamHeader :: Text Source #
The multistream-select protocol header.