MemoryProtoBook class

A memory-based implementation of the ProtoBook interface.

Implemented types

Constructors

MemoryProtoBook.new({int maxProtos = 128})
Creates a new memory-based protocol book implementation.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addProtocols(PeerId id, List<ProtocolID> protocols) Future<void>
AddProtocols adds the given protocols to the peer.
override
firstSupportedProtocol(PeerId id, List<ProtocolID> protocols) Future<ProtocolID?>
FirstSupportedProtocol returns the first protocol that the peer supports among the given protocols. If the peer does not support any of the given protocols, this function will return null.
override
getProtocols(PeerId id) Future<List<ProtocolID>>
GetProtocols returns the protocols registered for the given peer.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removePeer(PeerId id) Future<void>
RemovePeer removes all protocols associated with a peer.
override
removeProtocols(PeerId id, List<ProtocolID> protocols) → void
RemoveProtocols removes the given protocols from the peer.
override
setProtocols(PeerId id, List<ProtocolID> protocols) Future<void>
SetProtocols sets the protocols for the given peer (replacing any previously stored protocols).
override
supportsProtocols(PeerId id, List<ProtocolID> protocols) Future<List<ProtocolID>>
SupportsProtocols returns the set of protocols the peer supports from among the given protocols. If the returned error is not null, the result is indeterminate.
override
toString() String
A string representation of this object.
inherited

Operators

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