libp2p/multistream

    Dark Mode
Search:
Group by:
  Source   Edit

Types

HandlerHolder = object
  protos*: seq[string]
  protocol*: LPProtocol
  match*: Matcher
  Source   Edit
Matcher = proc (proto: string): bool {....gcsafe, raises: [Defect].}
  Source   Edit
MultiStreamError = object of LPError
  Source   Edit
MultistreamSelect = ref object of RootObj
  handlers*: seq[HandlerHolder]
  codec*: string
  Source   Edit

Consts

Codec = "/multistream/1.0.0"
  Source   Edit
Ls = "\x03ls\n"
  Source   Edit
MSCodec = "\x13/multistream/1.0.0\n"
  Source   Edit
MsgSize = 65536
  Source   Edit
Na = "\x03na\n"
  Source   Edit

Procs

proc addHandler(m: MultistreamSelect; codec: string; handler: LPProtoHandler;
                matcher: Matcher = nil) {....raises: [Defect], tags: [].}
helper to allow registering pure handlers   Source   Edit
proc addHandler(m: MultistreamSelect; codec: string; protocol: LPProtocol;
                matcher: Matcher = nil) {....raises: [Defect], tags: [RootEffect].}
  Source   Edit
proc addHandler(m: MultistreamSelect; codecs: seq[string]; protocol: LPProtocol;
                matcher: Matcher = nil) {....raises: [Defect], tags: [].}
  Source   Edit
proc handle(m: MultistreamSelect; conn: Connection; active: bool = false): Future[
    void] {....gcsafe, stackTrace: false, ...gcsafe, raises: [Defect],
            raises: [Defect], tags: [RootEffect].}
  Source   Edit
proc list(m: MultistreamSelect; conn: Connection): Future[seq[string]] {.
    stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect],
    tags: [RootEffect].}
list remote protos requests on connection   Source   Edit
proc new(T: typedesc[MultistreamSelect]): T:type {....raises: [Defect].}
  Source   Edit
proc select(m: MultistreamSelect; conn: Connection): Future[bool] {.
    ...raises: [Defect], tags: [RootEffect].}
  Source   Edit
proc select(m: MultistreamSelect; conn: Connection; proto: seq[string]): Future[
    string] {.stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect],
              tags: [RootEffect].}
  Source   Edit
proc select(m: MultistreamSelect; conn: Connection; proto: string): Future[bool] {.
    stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect],
    tags: [RootEffect].}
  Source   Edit
proc start(m: MultistreamSelect): Future[void] {.stackTrace: false, ...gcsafe,
    raises: [Defect], raises: [Defect], tags: [RootEffect].}
  Source   Edit
proc stop(m: MultistreamSelect): Future[void] {.stackTrace: false, ...gcsafe,
    raises: [Defect], raises: [Defect], tags: [RootEffect].}
  Source   Edit