You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is nice that MemoRef has a 'db lifetime, meaning that you can't call .garbage_collect / db.set/db.remove when there is a MemoRef, all of which could change its value or remove it.
I wonder if we can have something similar for SourceRef<'db>, where:
If a SourceRef exists, no deletions are allowed, but you can create/update sources
So there's a heirarchy:
MemoRef exists -> no changes to DB state
SourceRef exists -> no deletions of sources
Nothing exists -> anything allowed
Furthermore, I wonder if we can do this via ownership rules.
Right now, we can enforce that if a MemoRef exists, you can't mutate the DB because of ownership rules. Can we have two structs (e.g. a SourceRef only takes a reference to a sub-struct?) to pull this off with ownership rules?
Anyway, speculative and low-importance
The text was updated successfully, but these errors were encountered:
It is nice that
MemoRef
has a'db
lifetime, meaning that you can't call.garbage_collect
/db.set
/db.remove
when there is aMemoRef
, all of which could change its value or remove it.I wonder if we can have something similar for
SourceRef<'db>
, where:SourceRef
exists, no deletions are allowed, but you can create/update sourcesSo there's a heirarchy:
Furthermore, I wonder if we can do this via ownership rules.
Right now, we can enforce that if a
MemoRef
exists, you can't mutate the DB because of ownership rules. Can we have two structs (e.g. a SourceRef only takes a reference to a sub-struct?) to pull this off with ownership rules?Anyway, speculative and low-importance
The text was updated successfully, but these errors were encountered: