GitHub - yubessy/ToStruct.jl: Easy way to convert dict to struct · GitHub
Skip to content

yubessy/ToStruct.jl

Folders and files

Repository files navigation

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

About

Easy way to convert dict to struct

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages