{"id":13736483,"url":"https://github.com/planetis-m/bingo","last_synced_at":"2025-04-06T20:33:18.434Z","repository":{"id":161973687,"uuid":"318236196","full_name":"planetis-m/bingo","owner":"planetis-m","description":"Binary serialization framework for Nim","archived":false,"fork":false,"pushed_at":"2024-04-05T12:26:16.000Z","size":35,"stargazers_count":20,"open_issues_count":5,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-15T04:32:22.980Z","etag":null,"topics":["binary","deserialization","macro","marshal","marshalling","savedata","serialization","serialization-framework","unmarshalling"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planetis-m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-03T15:26:06.000Z","updated_at":"2024-05-08T11:01:53.000Z","dependencies_parsed_at":"2024-01-06T11:50:13.640Z","dependency_job_id":"51e29a89-3388-4061-886e-8f6fe8623d6f","html_url":"https://github.com/planetis-m/bingo","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetis-m%2Fbingo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetis-m%2Fbingo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetis-m%2Fbingo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetis-m%2Fbingo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetis-m","download_url":"https://codeload.github.com/planetis-m/bingo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247548794,"owners_count":20956800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","deserialization","macro","marshal","marshalling","savedata","serialization","serialization-framework","unmarshalling"],"created_at":"2024-08-03T03:01:22.603Z","updated_at":"2025-04-06T20:33:18.410Z","avatar_url":"https://github.com/planetis-m.png","language":"Nim","funding_links":[],"categories":["Data"],"sub_categories":["Serialization"],"readme":"# bingo — Binary serialization framework for Nim\n## About\nThis package provides the ``binTo``, ``loadBin`` procs which deserialize the specified\ntype from a ``Stream``. The `storeBin` procs are used to write the binary\nrepresentation of a location into a `Stream`. Low level `initFromBin` and `storeBin`\nprocs can be overloaded, in order to support arbitary container types, i.e.\n[marshal_smartptrs.nim](bingo/marshal_smartptrs.nim).\n\n## Usage\n\n```nim\nimport std/streams, bingo\n\ntype\n  Foo = ref object\n    value: int\n    next: Foo\n\nlet d = Foo(value: 1, next: Foo(value: 2, next: nil))\nlet s = newStringStream()\n# Make a roundtrip\ns.storeBin(d) # writes binary from a location\ns.setPosition(0)\nlet a = s.binTo(Foo) # reads binary and transform to a type\n# Alternatively load directly into a location\ns.setPosition(0)\nvar b: Foo\ns.loadBin(b)\n```\n\n## Features\n- Serializing and deserializing directly into `Streams`. For common usage it is done automatically.\n  Generally speaking intervation is needed when working with `ptr` types.\n- Supports `options`, `sets` and `tables` by default.\n- Overloading serialization procs.\n\n## Limitations\n- Limited support of object variants. The discriminant field is expected first.\n  Also there can be no fields before and after the case section.\n- Borrowing proc `initFromBin[T](dst: var T; s: Stream)` for distinct types isn't\n  currently working. Blocked by a Nim bug. Use overloads for now. Or you can easily\n  override this behaviour by copying these lines in your project:\n\n  ```nim\n  from typetraits import distinctBase\n  proc storeBin[T: distinct](s: Stream; x: T) = storeToBin(s, x.distinctBase)\n  proc initFromBin[T: distinct](dst: var T; s: Stream) = initFromBin(dst.distinctBase, p)\n  ```\n- Custom pragmas are not supported. Unless `hasCustomPragma` improves, this feature won't be added.\n  You can currently substitute skipped fields by creating empty overloads.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetis-m%2Fbingo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetis-m%2Fbingo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetis-m%2Fbingo/lists"}