Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 327 Bytes

README.md

File metadata and controls

28 lines (20 loc) · 327 Bytes

ToStruct.jl

Easy way to convert dict to struct

Installation

using Pkg
Pkg.add("ToStruct)

Usage

using ToStruct

struct Foo
    i::Int
    s::String
end

struct Bar
    foo::Foo
end

x = Dict("foo" => Dict("i" => 1, "s" => "hello"))
ToStruct.tostruct(Bar, x) == Bar(Foo(1, "hello")) # true