ToStruct.jl

Easy way to convert dict to struct
Author yubessy
Popularity
14 Stars
Updated Last
10 Months Ago
Started In
January 2019

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

Required Packages

No packages found.