Cyclic references
It is currently impossible to create a cycle between referred data structures.
For example:
#[derive(Persistent)]
struct Foo {
bar: Option<Ref<Bar>>
}
#[derive(Persistent)]
struct Bar {
foo: Option<Ref<Foo>>
}
is leading currently to the stack overflow because the Persistent derive macro generates a description that tries to describe such a cycle.
I am not sure if, in the case of Ref
, we need to describe the field tho.
I tried to expand the macro and comment out the bar
and foo
fields - structsy seems to be working correctly, and there is no overflow. But I'm unsure if I understand the purpose of get_description
.
Expected behaviour
Deriving structures that refer to each other should just work.
Actual behaviour
Stack overflow during DB initiation.
PS. I really like the project!