Fabiana Cecin ce918b0819
chore: replace Option with Opt (#4035)
* change all usage of std.options.Option[T] to results.Opt[T]
* fix broken apps and examples (to validate refactor)
* removed all std/options code added for libp2p v2 migration
* add broker Opt codec to persistency/backend_comm.nim
* add a readValue overload for Opt[T] in tools/confutils/cli_args.nim
* keep Option where required (Presto, confutils' config_file.nim)
* Change generateRlnProof error handling
* Fix imports
2026-07-16 14:02:17 -03:00

29 lines
625 B
Nim

import results
type PagingDirection* {.pure.} = enum
## PagingDirection determines the direction of pagination
BACKWARD = uint32(0)
FORWARD = uint32(1)
proc default*(): PagingDirection {.inline.} =
PagingDirection.FORWARD
proc into*(b: bool): PagingDirection =
PagingDirection(b)
proc into*(b: Opt[bool]): PagingDirection =
if b.isNone():
return default()
b.get().into()
proc into*(d: PagingDirection): bool =
d == PagingDirection.FORWARD
proc into*(d: Opt[PagingDirection]): bool =
if d.isNone():
return false
d.get().into()
proc into*(s: string): PagingDirection =
(s == "true").into()