libp2p/multicodec

Search:
Group by:
Source   Edit  

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: [], tags: [], forbids: [].}
Returns true if MultiCodecs a and b are not equal. Source   Edit  
proc `$`(mc: MultiCodec): string {....raises: [], tags: [], forbids: [].}
Returns string representation of MultiCodec mc. Source   Edit  
proc `==`(a, b: MultiCodec): bool {....raises: [], tags: [], forbids: [].}
Returns true if MultiCodecs a and b are equal. Source   Edit  
proc `==`(mc: MultiCodec; code: int): bool {.inline, ...raises: [], tags: [],
    forbids: [].}
Compares MultiCodec mc with integer code. Source   Edit  
proc `==`(mc: MultiCodec; name: string): bool {.inline, ...raises: [], tags: [],
    forbids: [].}
Compares MultiCodec mc with string name. Source   Edit  
proc codec(mt: typedesc[MultiCodec]; code: int): MultiCodec {.inline, ...raises: [].}
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: [].}
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: [], tags: [], forbids: [].}
Hash procedure for tables. Source   Edit  
proc multiCodec(code: int): MultiCodec {.compileTime, ...raises: [], tags: [],
    forbids: [].}
Generate MultiCodec from integer code at compile time. Source   Edit  
proc multiCodec(name: string): MultiCodec {.compileTime, ...raises: [], tags: [],
    forbids: [].}
Generate MultiCodec from string name at compile time. Source   Edit  
proc write(vb: var VBuffer; mc: MultiCodec) {.inline, ...raises: [], tags: [],
    forbids: [].}
Write MultiCodec to buffer vb. Source   Edit