libp2p/multicodec

    Dark Mode
Search:
Group by:
  Source   Edit

Nim-Libp2p Copyright (c) 2018 Status Research & Development GmbH

Licensed under either of

at your option. This file may not BE copied, modified, or distributed except according to those terms.

This module implements MultiCodec.List of officially supported codecs can BE found here https://github.com/multiformats/multicodec/blob/master/table.csv

Types

MultiCodec = distinct int
  Source   Edit
MultiCodecError = enum
  MultiCodecNotSupported
  Source   Edit

Procs

proc `!=`(a, b: MultiCodec): bool {....raises: [Defect], tags: [].}
Returns true if MultiCodecs a and b are not equal.   Source   Edit
proc `$`(mc: MultiCodec): string {....raises: [Defect], tags: [].}
Returns string representation of MultiCodec mc.   Source   Edit
proc `==`(a, b: MultiCodec): bool {....raises: [Defect], tags: [].}
Returns true if MultiCodecs a and b are equal.   Source   Edit
proc `==`(mc: MultiCodec; code: int): bool {.inline, ...raises: [Defect], tags: [].}
Compares MultiCodec mc with integer code.   Source   Edit
proc `==`(mc: MultiCodec; name: string): bool {.inline, ...raises: [Defect],
    tags: [].}
Compares MultiCodec mc with string name.   Source   Edit
proc codec(mt: typedesc[MultiCodec]; code: int): MultiCodec {.inline,
    ...raises: [Defect].}
Return MultiCodec from integer representation code. If code is not valid multicodec code, then InvalidMultiCodec will be returned.   Source   Edit
proc codec(mt: typedesc[MultiCodec]; name: string): MultiCodec {.inline,
    ...raises: [Defect].}
Return MultiCodec from string representation name. If name is not valid multicodec name, then InvalidMultiCodec will be returned.   Source   Edit
proc hash(m: MultiCodec): Hash {.inline, ...raises: [Defect], tags: [].}
Hash procedure for tables.   Source   Edit
proc multiCodec(code: int): MultiCodec {.compileTime, ...raises: [Defect], tags: [].}
Generate MultiCodec from integer code at compile time.   Source   Edit
proc multiCodec(name: string): MultiCodec {.compileTime, ...raises: [Defect],
    tags: [].}
Generate MultiCodec from string name at compile time.   Source   Edit
proc write(vb: var VBuffer; mc: MultiCodec) {.inline, ...raises: [Defect], tags: [].}
Write MultiCodec to buffer vb.   Source   Edit