pub enum PalaceCreation {
Allowed,
Forbidden,
}Expand description
Whether a sink is entitled to bring its target palace into EXISTENCE (#4638).
Why: the recorder’s palace id is derived from the session’s project root,
so an EPHEMERAL root yields an id that is unique per run — and drain’s
[ensure_palace] step then auto-created one permanent, unreadable palace
for every such run. That is how 5,667 t-tmp<random> orphans accumulated
in three weeks (97.8% of every palace on the machine), which in turn made
trusty-memory’s O(n) full-registry handlers (#4637) unusable. A palace is
an expensive object (usearch vector index, KG redb, drawer table, recall
log), not a cheap per-session namespace, so the entitlement to mint one is
modelled explicitly rather than left implicit in “whoever writes first
wins”. Making it a two-variant enum rather than a bool parameter means no
call site can pass the dangerous value by accident.
What: Self::Allowed reproduces the pre-#4638 behavior exactly (probe,
then palace_create on a miss — #2424); Self::Forbidden probes and
writes into a palace that already exists but never creates one, so a sink
carrying it can never increase the palace count.
Test: memory_sink::tests::forbidden_creation_never_creates_a_palace,
memory_sink::tests::ensure_palace_creates_missing_palace_once.
Variants§
Allowed
The project root is durable — auto-create the palace if missing (#2424).
Forbidden
The project root is ephemeral — never auto-create (#4638).
Trait Implementations§
Source§impl Clone for PalaceCreation
impl Clone for PalaceCreation
impl Copy for PalaceCreation
Source§impl Debug for PalaceCreation
impl Debug for PalaceCreation
impl Eq for PalaceCreation
Source§impl PartialEq for PalaceCreation
impl PartialEq for PalaceCreation
impl StructuralPartialEq for PalaceCreation
Auto Trait Implementations§
impl Freeze for PalaceCreation
impl RefUnwindSafe for PalaceCreation
impl Send for PalaceCreation
impl Sync for PalaceCreation
impl Unpin for PalaceCreation
impl UnsafeUnpin for PalaceCreation
impl UnwindSafe for PalaceCreation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more