import std/typetraits, preserves type Notify* {.preservesRecord: "notify".} = object `summary`*: string `body`*: Preserve[void] `timeout`*: BiggestInt `urgency`*: Urgency `Urgency`* {.preservesOr, pure.} = enum `Low`, `Normal`, `Critical` proc `$`*(x: Notify): string = `$`(toPreserve(x)) proc encode*(x: Notify): seq[byte] = encode(toPreserve(x))