Skip to content

felipenoris/BSONSerializer.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BSONSerializer.jl

License travis codecov

Encode/Decode your Julia structures to/from BSON.

Requirements

  • Julia v1.1

Usage

using BSONSerializer

struct MyType
    str::String
    num::Int
end

# this macro will generate
# serialize/deserialize code
@BSONSerializable(MyType)

instance = MyType("hey", 101)
bson = BSONSerializer.serialize(instance)
println(bson)

new_instance = BSONSerializer.deserialize(bson)
@assert new_instance == instance

Generated BSON:

{
  "type": "MyType",
  "args": {
    "str": "hey",
    "num": 101
  }
}

Alternative Packages

About

Encode/Decode your Julia structures to/from BSON.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages