| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
LibP2P.Multiaddr.Codec
Description
Binary and text encoding/decoding for multiaddr.
Synopsis
- encodeProtocols :: [Protocol] -> ByteString
- decodeProtocols :: ByteString -> Either String [Protocol]
- protocolsToText :: [Protocol] -> Text
- textToProtocols :: Text -> Either String [Protocol]
Documentation
encodeProtocols :: [Protocol] -> ByteString Source #
Encode a list of protocols to binary multiaddr format.
decodeProtocols :: ByteString -> Either String [Protocol] Source #
Decode binary multiaddr format to a list of protocols.
protocolsToText :: [Protocol] -> Text Source #
Convert a list of protocols to human-readable text form.
textToProtocols :: Text -> Either String [Protocol] Source #
Parse human-readable text form to a list of protocols.
Strict per the multiaddr spec and go-multiaddr behaviour: the input
must be non-empty, must begin with /, and must not contain empty
components (so a bare /, doubled slashes, and trailing slashes are
all rejected).