StructTypes.jl
StructTypes.jl copied to clipboard
missing `constructfrom` method for `CustomStruct`?
Perhaps I'm misunderstanding the intention of CustomStruct but I believe it is missing a constructfrom method. Even after defining the required methods I get, e.g.
◖◗ ST.constructfrom(Dict{String,Any}, c)
ERROR: MethodError: no method matching constructfrom(::StructTypes.DictType, ::Type{Dict{String, Any}}, ::Type{String}, ::Type{Any}, ::StructTypes.CustomStruct, ::Column{Int64, Count})
Closest candidates are:
constructfrom(::StructTypes.DictType, ::Type{T}, ::Type{K}, ::Type{V}, ::StructTypes.DictType, ::Any) where {T, K, V} at ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:961
constructfrom(::StructTypes.DictType, ::Type{T}, ::Type{K}, ::Type{V}, ::Union{StructTypes.Mutable, StructTypes.Struct}, ::Any) where {T, K, V} at ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:978
constructfrom(::StructTypes.DictType, ::Type{T}, ::Type{K}, ::Type{V}, ::S) where {T, K, V, S} at ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:958
...
Stacktrace:
[1] constructfrom
@ ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:958 [inlined]
[2] constructfrom(#unused#::StructTypes.DictType, #unused#::Type{Dict{String, Any}}, obj::Column{Int64, Count})
@ StructTypes ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:955
[3] constructfrom(#unused#::Type{Dict{String, Any}}, obj::Column{Int64, Count})
@ StructTypes ~/.julia/packages/StructTypes/Cmlkm/src/StructTypes.jl:905
[4] top-level scope
@ REPL[13]:1
I had defined StructTypes.lowertype(::Type{<:Column}) = Dict{String,Any}, so I was expecting this to work.
It might help to explain a bit more what I'm trying to do: I have a type Column{T,S} and I would like to serialize T,S as strings, but they are not involved in any field of the struct. As far as I can tell, this precludes the use of StructTypes.Struct().