Protocol enum

A Multiaddr protocol enum.

Defined at multiformats/multicodec.

Inheritance

Constructors

Protocol(String name, int code, int size, bool hasPath, [Encoder? valueEncoder, Decoder? valueDecoder])
const
Protocol.fromCode(int code)
factory
Protocol.fromName(String name)
factory
Protocol.fromVcode(Uint8List vcode)
factory

Values

ip4 → const Protocol
const Protocol('ip4', 0x04, 32, false, ip4Encoder, ip4Decoder)
tcp → const Protocol
const Protocol('tcp', 0x06, 16, false, tcpEncoder, tcpDecoder)
ip6 → const Protocol
const Protocol('ip6', 0x29, 128, false, ip6Encoder, ip6Decoder)
dns → const Protocol
const Protocol('dns', 0x35, lengthPrefixed, false, dnsEncoder, dnsDecoder)
dns4 → const Protocol
const Protocol('dns4', 0x36, lengthPrefixed, false, dnsEncoder, dnsDecoder)
dns6 → const Protocol
const Protocol('dns6', 0x37, lengthPrefixed, false, dnsEncoder, dnsDecoder)
dnsaddr → const Protocol
const Protocol('dnsaddr', 0x38, lengthPrefixed, false, dnsEncoder, dnsDecoder)
p2pCircuit → const Protocol
const Protocol('p2p-circuit', 0x0122, 0, false)
unix → const Protocol
const Protocol('unix', 0x0190, lengthPrefixed, true, unixEncoder, unixDecoder)
quic → const Protocol
const Protocol('quic', 0x01cc, 0, false)
quicV1 → const Protocol
const Protocol('quic-v1', 0x01cd, 0, false)
ws → const Protocol
const Protocol('ws', 0x01dd, 0, false)

Properties

code int
The protocol's multicodec (a normal, non-varint number).
final
hashCode int
The hash code for this object.
no setterinherited
hasPath bool
True if the protocol takes path arguments, and size must be negative.
final
index int
A numeric identifier for the enumerated value.
no setterinherited
name String
The string representation of the protocol. E.g., ip4, tcp, etc.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
The size of the protocol's data field.
final
valueDecoder → Decoder?
The Encoder and Decoder for protocol value.
final
valueEncoder → Encoder?
The Encoder for protocol value.
final
vcode Uint8List
Varint encoded version of code.
no setter

Methods

decodeValue(Uint8List bytes) String
encodeValue(String value) Uint8List
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<Protocol>
A constant List of the values in this enum, in order of their declaration.