https://github.com/sam0x17/marshal
Allows deep copying, storing, and loading of crystal objects, even across different executions.
https://github.com/sam0x17/marshal
Last synced: 3 months ago
JSON representation
Allows deep copying, storing, and loading of crystal objects, even across different executions.
- Host: GitHub
- URL: https://github.com/sam0x17/marshal
- Owner: sam0x17
- License: mit
- Created: 2019-10-14T10:17:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-12T05:15:12.000Z (almost 6 years ago)
- Last Synced: 2025-02-13T08:14:48.825Z (11 months ago)
- Language: Crystal
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# marshal
The purpose of this shard is to provide easy-to-use marshaling of crystal objects
without any work needed on the part of the programmer. There are no modules to
include, simply `require "marshal"` and you can use `obj.marshal_pack` on any
object to pack it into bytes and `Klass.marshal_unpack(bytes)` to unpack any
object that was packed using the library.
Marshal goes to great lengths to try to work out of the box for most types,
but some types will cause it to fail. It is recommended that you write
specs similar to those in the `marshal_spec.cr` file for whatever types
you plan to use before using this.
The shard is under development though the core API will never change. This
is not production stable but with a few specs you can have confidence
it will work in your particular scenario.
This is basically messagepack for the lazy.