Opt-in helper module for serializing the stdlib Port type

This commit is contained in:
Zahary Karadjov 2019-06-20 15:35:17 +03:00
parent f9e06671ce
commit a1baedeb1b
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
import std/net, ../../json_serialization.nim
export json_serialization
proc writeValue*(writer: var JsonWriter, value: Port) =
writeValue(writer, uint16 value)
proc readValue*(reader: var JsonReader, value: var Port) =
value = Port reader.readValue(uint16)