2018-11-27 12:16:04 +00:00
|
|
|
## Nim-Libp2p
|
|
|
|
## Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
## Licensed under either of
|
|
|
|
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
|
|
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
|
|
## at your option.
|
|
|
|
## This file may not be copied, modified, or distributed except according to
|
|
|
|
## those terms.
|
|
|
|
|
|
|
|
## This module implements transcoder interface.
|
|
|
|
import vbuffer
|
|
|
|
|
|
|
|
type
|
|
|
|
Transcoder* = object
|
2018-12-05 15:24:07 +00:00
|
|
|
stringToBuffer*: proc(s: string,
|
2020-05-31 14:22:49 +00:00
|
|
|
vb: var VBuffer): bool {.nimcall, gcsafe, raises: [Defect].}
|
2018-12-05 15:24:07 +00:00
|
|
|
bufferToString*: proc(vb: var VBuffer,
|
2020-05-31 14:22:49 +00:00
|
|
|
s: var string): bool {.nimcall, gcsafe, raises: [Defect].}
|
|
|
|
validateBuffer*: proc(vb: var VBuffer): bool {.nimcall, gcsafe, raises: [Defect].}
|