Index
Modules:
cbor_serialization
,
cbor_serialization/format
,
cbor_serialization/parser
,
cbor_serialization/reader
,
cbor_serialization/reader_desc
,
cbor_serialization/reader_impl
,
cbor_serialization/types
,
cbor_serialization/utils
,
cbor_serialization/writer
.
API symbols
`$`:
types: proc `$`(v: CborSimpleValue): string
`==`:
types: proc `==`(a, b: CborBytes): bool
types: proc `==`(a: CborBytes; b: seq[byte]): bool
types: proc `==`(a, b: CborSimpleValue): bool
types: proc `==`(lhs, rhs: CborValueRef): bool
types: proc `==`(a: seq[byte]; b: CborBytes): bool
add:
types: proc add(a: var CborBytes; b: byte)
allowsUnknownFields:
format: template allowsUnknownFields(F: type Cbor; T: type DefaultFlavor): bool
beginArray:
writer: proc beginArray(w: var CborWriter; length = -1)
beginBytes:
writer: proc beginBytes(w: var CborWriter; length = -1)
beginObject:
writer: proc beginObject(w: var CborWriter; length = -1)
beginText:
writer: proc beginText(w: var CborWriter; length = -1)
Cbor:
format: object Cbor
cborBreakStopCode:
types: const cborBreakStopCode
CborBytes:
types: type CborBytes
CborError:
types: object CborError
cborFalse:
types: const cborFalse
CborIncompleteObjectError:
reader_desc: object CborIncompleteObjectError
CborIntOverflowError:
reader_desc: object CborIntOverflowError
cborKind:
parser: proc cborKind(p: CborParser): CborValueKind
CborMajor:
types: enum CborMajor
cborMinorIndef:
types: const cborMinorIndef
cborMinorLen0:
types: const cborMinorLen0
cborMinorLen1:
types: const cborMinorLen1
cborMinorLen2:
types: const cborMinorLen2
cborMinorLen4:
types: const cborMinorLen4
cborMinorLen8:
types: const cborMinorLen8
cborMinorLens:
types: const cborMinorLens
CborNotEnoughBytesError:
reader_desc: object CborNotEnoughBytesError
cborNull:
types: const cborNull
CborNumber:
types: object CborNumber
CborObjectType:
types: type CborObjectType
CborParser:
reader_desc: object CborParser
CborReader:
reader_desc: object CborReader
CborReaderConf:
types: object CborReaderConf
CborReaderError:
reader_desc: object CborReaderError
CborSign:
types: enum CborSign
CborSimpleValue:
types: type CborSimpleValue
CborTag:
types: object CborTag
cborTrue:
types: const cborTrue
cborUndefined:
types: const cborUndefined
CborUnexpectedFieldError:
reader_desc: object CborUnexpectedFieldError
CborUnexpectedValueError:
reader_desc: object CborUnexpectedValueError
CborValue:
types: object CborValue
CborValueKind:
types: enum CborValueKind
CborValueRef:
types: type CborValueRef
CborVoid:
types: object CborVoid
CborWriter:
writer: object CborWriter
configureCborDeserialization:
reader_impl: template configureCborDeserialization(T: type[enum]; allowNumericRepr: static[bool] = false; stringNormalizer: static[proc (s: string): string] = strictNormalize)
configureCborSerialization:
writer: template configureCborSerialization(Flavor: type; T: type[enum]; enumRep: static[EnumRepresentation])
writer: template configureCborSerialization(T: type[enum]; enumRep: static[EnumRepresentation])
contains:
types: proc contains(x: set[uint8]; y: CborSimpleValue): bool
createCborFlavor:
format: template createCborFlavor(FlavorName: untyped; mimeTypeValue = "application/cbor"; automaticObjectSerialization = false; automaticPrimitivesSerialization = true; requireAllFields = true; omitOptionalFields = true; allowUnknownFields = true; skipNullFields = false)
decodeHalf:
utils: proc decodeHalf(half: uint16): float
defaultBuiltinReader:
format: template defaultBuiltinReader(Flavor: type)
defaultBuiltinSerialization:
format: template defaultBuiltinSerialization(Flavor: type)
defaultBuiltinWriter:
format: template defaultBuiltinWriter(Flavor: type)
defaultCborReaderConf:
types: const defaultCborReaderConf
defaultObjectReader:
format: template defaultObjectReader(Flavor: type)
defaultObjectSerialization:
format: template defaultObjectSerialization(Flavor: type)
defaultObjectWriter:
format: template defaultObjectWriter(Flavor: type)
defaultPrimitiveReader:
format: template defaultPrimitiveReader(Flavor: type)
defaultPrimitiveSerialization:
format: template defaultPrimitiveSerialization(Flavor: type)
defaultPrimitiveWriter:
format: template defaultPrimitiveWriter(Flavor: type)
defaultReader:
format: template defaultReader(Flavor: type; T: untyped)
defaultReaders:
format: template defaultReaders(Flavor: type)
defaultSerialization:
format: template defaultSerialization(Flavor: type)
format: template defaultSerialization(Flavor: type; T: untyped)
defaultWriter:
format: template defaultWriter(Flavor: type; T: untyped)
defaultWriters:
format: template defaultWriters(Flavor: type)
endArray:
writer: proc endArray(w: var CborWriter; stopCode = true)
endBytes:
writer: proc endBytes(w: var CborWriter; stopCode = true)
endObject:
writer: proc endObject(w: var CborWriter; stopCode = true)
endText:
writer: proc endText(w: var CborWriter; stopCode = true)
EnumAsNumber:
format: EnumRepresentation.EnumAsNumber
EnumAsString:
format: EnumRepresentation.EnumAsString
EnumAsStringifiedNumber:
format: EnumRepresentation.EnumAsStringifiedNumber
enumRep:
format: template enumRep(T: type Cbor): EnumRepresentation
format: template enumRep(T: type Cbor; rep: static[EnumRepresentation])
format: template enumRep(F: type Cbor; T: type DefaultFlavor): EnumRepresentation
format: template enumRep(F: type Cbor; T: type DefaultFlavor; rep: static[EnumRepresentation])
EnumRepresentation:
format: enum EnumRepresentation
expectedFieldsBitmask:
reader_impl: proc expectedFieldsBitmask(F: type Cbor; TT: type; fields: static int): auto
flavorEnumRep:
format: template flavorEnumRep(T: type Cbor)
format: template flavorEnumRep(T: type Cbor; rep: static[EnumRepresentation])
formatMsg:
reader_desc: method formatMsg(err: ref CborIncompleteObjectError; filename: string): string
reader_desc: method formatMsg(err: ref CborIntOverflowError; filename: string): string
reader_desc: method formatMsg(err: ref CborNotEnoughBytesError; filename: string): string
reader_desc: method formatMsg(err: ref CborReaderError; filename: string): string
reader_desc: method formatMsg(err: ref CborUnexpectedValueError; filename: string): string
init:
reader_desc: proc init(T: type CborParser; stream: InputStream; conf: CborReaderConf = defaultCborReaderConf): T:type
reader_desc: proc init(T: type CborReader; stream: InputStream; conf: CborReaderConf = defaultCborReaderConf): T:type
writer: proc init(W: type CborWriter; stream: OutputStream): W:type
isFalse:
types: proc isFalse(v: CborSimpleValue): bool
isFalsy:
types: proc isFalsy(v: CborSimpleValue): bool
isFieldExpected:
reader_impl: proc isFieldExpected(F: type Cbor; T: type): bool
isNull:
types: proc isNull(v: CborSimpleValue): bool
isNullish:
types: proc isNullish(v: CborSimpleValue): bool
isTrue:
types: proc isTrue(v: CborSimpleValue): bool
isUndefined:
types: proc isUndefined(v: CborSimpleValue): bool
lenMaybe:
parser: proc lenMaybe(p: var CborParser): int
mimeType:
format: template mimeType(T: type Cbor): string
omitsOptionalFields:
format: template omitsOptionalFields(F: type Cbor; T: type DefaultFlavor): bool
parseArray:
parser: template parseArray(r: var CborReader; body: untyped)
parser: template parseArray(r: var CborReader; idx, body: untyped)
parseArray2:
parser: template parseArray2(r: var CborReader; arrLen, body: untyped)
parseBool:
parser: proc parseBool(r: var CborReader): bool
parseByteString:
parser: proc parseByteString(r: var CborReader): seq[byte]
parser: proc parseByteString(r: var CborReader; limit: int): seq[byte]
parseByteStringIt:
parser: iterator parseByteStringIt(r: var CborReader; limit: int; safeBreak: static[bool] = true): byte
parser: iterator parseByteStringIt(r: var CborReader; safeBreak: static[bool] = true): byte
parseFloat:
parser: proc parseFloat(r: var CborReader; T: type SomeFloat): T:type
parseInt:
parser: proc parseInt(r: var CborReader; T: type SomeInteger): T:type
parseNumber:
parser: proc parseNumber(r: var CborReader): CborNumber
parser: proc parseNumber(r: var CborReader; val: var CborNumber)
parseObject:
parser: template parseObject(r: var CborReader; key: untyped; body: untyped)
parseObjectCustomKey:
parser: template parseObjectCustomKey(r: var CborReader; keyAction, body: untyped)
parseObjectWithoutSkip:
parser: template parseObjectWithoutSkip(r: var CborReader; key: untyped; body: untyped)
parseSimpleValue:
parser: proc parseSimpleValue(r: var CborReader): CborSimpleValue
parseString:
parser: proc parseString(r: var CborReader): string
parser: proc parseString(r: var CborReader; limit: int): string
parseStringIt:
parser: iterator parseStringIt(r: var CborReader; limit: int; safeBreak: static[bool] = true): char
parser: iterator parseStringIt(r: var CborReader; safeBreak: static[bool] = true): char
parseTag:
parser: template parseTag(r: var CborReader; tag: untyped; body: untyped)
parseValue:
parser: proc parseValue(r: var CborReader): CborValueRef
parser: proc parseValue(r: var CborReader; val: var CborBytes)
parser: proc parseValue(r: var CborReader; val: var CborValueRef)
PreferredOutputType:
writer: template PreferredOutputType(T`gensym0: type Cbor): type
raiseIncompleteObject:
reader_desc: proc raiseIncompleteObject(p: CborParser; objectType: cstring)
reader_desc: template raiseIncompleteObject(r: CborReader; objectType: cstring)
raiseIntOverflow:
reader_desc: proc raiseIntOverflow(p: CborParser; absIntVal: BiggestUInt; isNegative: bool)
raiseNotEnoughBytes:
reader_desc: proc raiseNotEnoughBytes(p: CborParser; msg: string)
raiseUnexpectedField:
reader_desc: proc raiseUnexpectedField(p: CborParser; fieldName: string; deserializedType: cstring)
raiseUnexpectedValue:
reader_desc: proc raiseUnexpectedValue(p: CborParser; msg: string)
reader_desc: proc raiseUnexpectedValue(p: CborParser; expected, found: string)
reader_desc: template raiseUnexpectedValue(r: CborReader; msg: string)
read:
reader_impl: proc read[N](r: var CborReader; value: var array[N, char])
reader_impl: proc read(r: var CborReader; value: var bool)
reader_impl: proc read(r: var CborReader; value: var CborBytes)
reader_impl: proc read(r: var CborReader; value: var CborNumber)
reader_impl: proc read(r: var CborReader; value: var CborSimpleValue)
reader_impl: proc read(r: var CborReader; value: var CborTag)
reader_impl: proc read(r: var CborReader; value: var CborValueRef)
reader_impl: proc read(r: var CborReader; value: var CborVoid)
reader_impl: proc read[T](r: var CborReader; value: var ptr T)
reader_impl: proc read[T](r: var CborReader; value: var ref T)
reader_impl: proc read(r: var CborReader; value: var seq[byte])
reader_impl: proc read(r: var CborReader; value: var seq[char])
reader_impl: proc read[T](r: var CborReader; value: var seq[T])
reader_impl: proc read(r: var CborReader; value: var string)
reader_impl: proc read[T: object](r: var CborReader; value: var T)
reader_impl: proc read[T: tuple](r: var CborReader; value: var T)
reader_impl: proc read[T: enum](r: var CborReader; value: var T)
reader_impl: proc read[T: SomeInteger](r: var CborReader; value: var T)
reader_impl: proc read[T: SomeFloat](r: var CborReader; value: var T)
reader_impl: proc read[T: array](r: var CborReader; value: var T)
readArray:
reader_impl: iterator readArray(r: var CborReader; ElemType: typedesc): ElemType:type
Reader:
reader_desc: template Reader(T`gensym0: type Cbor; F`gensym0: distinct type = Flavor`gensym0): type
ReaderType:
reader_desc: template ReaderType(T`gensym0: type Cbor; F`gensym0: distinct type = Flavor`gensym0): type
readObject:
reader_impl: iterator readObject(r: var CborReader; KeyType: type; ValueType: type): (KeyType:type, ValueType:type)
readObjectFields:
reader_impl: iterator readObjectFields(r: var CborReader): string
reader_impl: iterator readObjectFields(r: var CborReader; KeyType: type): KeyType:type
readRecordValue:
reader_impl: template readRecordValue(r: var CborReader; value: var object)
readValue:
reader_desc: template readValue[U: Reader(Cbor); W: string](r`gensym7: var U; value`gensym7: var W)
reader_desc: template readValue[U: Reader(Cbor); W: openArray](r`gensym52: var U; value`gensym52: var W)
reader_desc: template readValue[U: Reader(Cbor); W: range](r`gensym57: var U; value`gensym57: var W)
reader_desc: template readValue[U: Reader(Cbor); W: CborNumber](r`gensym63: var U; value`gensym63: var W)
reader_desc: template readValue[U: Reader(Cbor); W: CborTag](r`gensym68: var U; value`gensym68: var W)
reader_desc: template readValue[U: Reader(Cbor); W: CborVoid](r`gensym73: var U; value`gensym73: var W)
reader_desc: template readValue[U: Reader(Cbor); W: CborValueRef](r`gensym78: var U; value`gensym78: var W)
reader_desc: template readValue[U: Reader(Cbor); W: TT`gensym77](r`gensym83: var U; value`gensym83: var W)
reader_desc: template readValue[U: Reader(Cbor); W: CborSimpleValue](r`gensym86: var U; value`gensym86: var W)
reader_desc: template readValue[U: Reader(Cbor); W: CborBytes](r`gensym91: var U; value`gensym91: var W)
reader_desc: template readValue[U: Reader(Cbor); W: object](r`gensym97: var U; value`gensym97: var W)
reader_desc: template readValue[U: Reader(Cbor); W: bool](r`gensym12: var U; value`gensym12: var W)
reader_desc: template readValue[U: Reader(Cbor); W: tuple](r`gensym102: var U; value`gensym102: var W)
reader_desc: template readValue[U: Reader(Cbor); W: ref](r`gensym17: var U; value`gensym17: var W)
reader_desc: template readValue[U: Reader(Cbor); W: ptr](r`gensym22: var U; value`gensym22: var W)
reader_desc: template readValue[U: Reader(Cbor); W: enum](r`gensym27: var U; value`gensym27: var W)
reader_desc: template readValue[U: Reader(Cbor); W: SomeInteger](r`gensym32: var U; value`gensym32: var W)
reader_desc: template readValue[U: Reader(Cbor); W: SomeFloat](r`gensym37: var U; value`gensym37: var W)
reader_desc: template readValue[U: Reader(Cbor); W: seq](r`gensym42: var U; value`gensym42: var W)
reader_desc: template readValue[U: Reader(Cbor); W: array](r`gensym47: var U; value`gensym47: var W)
requiresAllFields:
format: template requiresAllFields(F: type Cbor; T: type DefaultFlavor): bool
shouldWriteObjectField:
writer: template shouldWriteObjectField[FieldType](F: type Cbor; field: FieldType): bool
skipSingleValue:
parser: proc skipSingleValue(r: var CborReader)
skipsNullFields:
format: template skipsNullFields(F: type Cbor; T: type DefaultFlavor): bool
streamElement:
writer: template streamElement(w: var CborWriter; streamVar: untyped; body: untyped)
supports:
format: template supports(_: type Cbor; T: type): bool
toBytes:
types: template toBytes(val: CborBytes): untyped
toCbor:
writer: proc toCbor(v: auto; Flavor = DefaultFlavor): seq[byte]
toInt:
types: proc toInt(val: CborNumber; T: type SomeSignedInt): Opt[T]
types: proc toInt(val: CborNumber; T: type SomeUnsignedInt): Opt[T]
types: proc toInt(sign: CborSign): int
totalExpectedFields:
reader_impl: proc totalExpectedFields(T: type): int
versionInt:
format: template versionInt(T: type Cbor): uint
write:
writer: proc write(w: var CborWriter; val: bool)
writer: proc write(w: var CborWriter; val: CborBytes)
writer: proc write(w: var CborWriter; value: CborNumber)
writer: proc write(w: var CborWriter; value: CborObjectType)
writer: proc write(w: var CborWriter; val: CborSimpleValue)
writer: proc write(w: var CborWriter; val: CborTag)
writer: proc write(w: var CborWriter; value: CborValue)
writer: proc write(w: var CborWriter; val: CborVoid)
writer: proc write(w: var CborWriter; val: cstring)
writer: proc write(w: var CborWriter; val: openArray[char])
writer: proc write[T](w: var CborWriter; values: openArray[T])
writer: proc write[T](w: var CborWriter; val: ref T)
writer: proc write(w: var CborWriter; val: seq[byte])
writer: proc write[T: SomeInteger](w: var CborWriter; val: T)
writer: proc write[T: SomeFloat](w: var CborWriter; val: T)
writer: proc write[T: object](w: var CborWriter; value: T)
writer: proc write[T: tuple](w: var CborWriter; value: T)
writer: proc write[T: range](w: var CborWriter; val: T)
writer: proc write[T: distinct](w: var CborWriter; val: T)
writer: template write(w: var CborWriter; value: enum)
writeArray:
writer: template writeArray[T: void](w: var CborWriter; body: T)
writeByte:
writer: proc writeByte(w: var CborWriter; x: byte)
writeBytes:
writer: template writeBytes(w: var CborWriter; length: int; body: untyped)
writer: template writeBytes(w: var CborWriter; body: untyped)
writeChar:
writer: proc writeChar(w: var CborWriter; x: char)
writeField:
writer: proc writeField[V: not void](w: var CborWriter; name: string; value: V)
writer: template writeField[T: void](w: var CborWriter; name: string; body: T)
writeIterable:
writer: proc writeIterable(w: var CborWriter; collection: auto)
writeName:
writer: proc writeName(w: var CborWriter; name: string)
writeObject:
writer: template writeObject[T: void](w: var CborWriter; body: T)
writeObjectField:
writer: template writeObjectField[FieldType, ObjectType](w: var CborWriter; obj: ObjectType; fieldName: static string; field: FieldType)
Writer:
writer: template Writer(T`gensym0: type Cbor; F`gensym0: distinct type = Flavor`gensym0): type
writeRecordValue:
writer: template writeRecordValue(w: var CborWriter; value: object)
WriterType:
writer: template WriterType(T`gensym0: type Cbor; F`gensym0: distinct type = Flavor`gensym0): type
writeText:
writer: template writeText(w: var CborWriter; length: int; body: untyped)
writer: template writeText(w: var CborWriter; body: untyped)
writeValue:
writer: template writeValue[U: Writer(Cbor); W: string](w`gensym7: var U; value`gensym7: W)
writer: template writeValue[U: Writer(Cbor); W: cstring](w`gensym52: var U; value`gensym52: W)
writer: template writeValue[U: Writer(Cbor); W: openArray](w`gensym57: var U; value`gensym57: W)
writer: template writeValue[U: Writer(Cbor); W: range](w`gensym62: var U; value`gensym62: W)
writer: template writeValue[U: Writer(Cbor); W: distinct](w`gensym67: var U; value`gensym67: W)
writer: template writeValue[U: Writer(Cbor); W: CborNumber](w`gensym73: var U; value`gensym73: W)
writer: template writeValue[U: Writer(Cbor); W: CborTag](w`gensym78: var U; value`gensym78: W)
writer: template writeValue[U: Writer(Cbor); W: CborVoid](w`gensym83: var U; value`gensym83: W)
writer: template writeValue[U: Writer(Cbor); W: CborValueRef](w`gensym88: var U; value`gensym88: W)
writer: template writeValue[U: Writer(Cbor); W: TT`gensym87](w`gensym93: var U; value`gensym93: W)
writer: template writeValue[U: Writer(Cbor); W: CborSimpleValue](w`gensym96: var U; value`gensym96: W)
writer: template writeValue[U: Writer(Cbor); W: bool](w`gensym12: var U; value`gensym12: W)
writer: template writeValue[U: Writer(Cbor); W: CborBytes](w`gensym101: var U; value`gensym101: W)
writer: template writeValue[U: Writer(Cbor); W: object](w`gensym107: var U; value`gensym107: W)
writer: template writeValue[U: Writer(Cbor); W: tuple](w`gensym112: var U; value`gensym112: W)
writer: template writeValue[U: Writer(Cbor); W: ref](w`gensym17: var U; value`gensym17: W)
writer: template writeValue[U: Writer(Cbor); W: ptr](w`gensym22: var U; value`gensym22: W)
writer: template writeValue[U: Writer(Cbor); W: enum](w`gensym27: var U; value`gensym27: W)
writer: template writeValue[U: Writer(Cbor); W: SomeInteger](w`gensym32: var U; value`gensym32: W)
writer: template writeValue[U: Writer(Cbor); W: SomeFloat](w`gensym37: var U; value`gensym37: W)
writer: template writeValue[U: Writer(Cbor); W: seq](w`gensym42: var U; value`gensym42: W)
writer: template writeValue[U: Writer(Cbor); W: array](w`gensym47: var U; value`gensym47: W)