Convert any Nim objects, numbers, strings, refs to and from binary format.
Types
FlattyError = object of CatchableError
- Raised when decoding malformed input: a negative or oversized length / element count, or an undefined enum discriminator (out of range or a hole in a discontinuous enum). Truncated reads raise IndexDefect from the binny layer; catch both to fully contain a hostile payload. Source Edit
Procs
proc fromFlatty(s: string; i: var int; x: var bool) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var char) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var cstring) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var float32) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var float64) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var int) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var int8) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var int16) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var int32) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var int64) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var pointer) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var proc) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var string) {....raises: [FlattyError], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var uint) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var uint8) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var uint16) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var uint32) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty(s: string; i: var int; x: var uint64) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fromFlatty[K, V](s: string; i: var int; x: var SomeTable[K, V])
- Source Edit
proc fromFlatty[K](s: string; i: var int; x: var CountTable[K])
- Source Edit
proc fromFlatty[N, T](s: string; i: var int; x: var array[N, T])
- Source Edit
proc fromFlatty[T: distinct](s: string; i: var int; x: var T)
- Source Edit
proc fromFlatty[T: enum and not range](s: string; i: var int; x: var T)
- Source Edit
proc fromFlatty[T: object](s: string; i: var int; x: var T)
- Source Edit
proc fromFlatty[T: range](s: string; i: var int; x: var T)
- Source Edit
proc fromFlatty[T: tuple](s: string; i: var int; x: var T)
- Source Edit
proc fromFlatty[T: UnsupportedHandle](s: string; i: var int; x: var T) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc fromFlatty[T](s: string; i: var int; x: var ptr T) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc fromFlatty[T](s: string; i: var int; x: var ref T)
- Source Edit
proc fromFlatty[T](s: string; i: var int; x: var seq[T])
- Source Edit
proc fromFlatty[T](s: string; i: var int; x: var SomeSet[T])
- Source Edit
proc fromFlatty[T](s: string; x: typedesc[T]): T
- Takes binary string and turn into structures. Source Edit
proc toFlatty(s: var string; x: cstring) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc toFlatty(s: var string; x: pointer) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc toFlatty(s: var string; x: proc) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit
proc toFlatty[T: UnsupportedHandle](s: var string; x: T) {.error: "flatty can only serialize Nim-owned values; raw pointers, cstrings, procs, and distinct OS handles cannot be flattened".}
- Source Edit