pub enum KeyScope {
Private(String),
Shared,
}Expand description
Scope selector for a keyed slot (Phase 12.1.1). A keyed
remember’s slot is always identified by (scope_owner, key):
Private(agent_id) slots are per-agent, Shared slots are per-file.
history_in(key, scope) uses the same selector so the lookup matches
the write exactly.
The convenience crate::Mnemo::history is equivalent to
history_in(key, KeyScope::Private(agent.unwrap_or("default"))) —
i.e. history(key, None) resolves to the default agent’s private
slot, matching the remember(…, agent_id=None, scope=Private, key=K)
write path. Use crate::Mnemo::history_in with
KeyScope::Shared when you need the shared slot.
Variants§
Private(String)
Per-agent slot. The agent id is the one carried on Memory.agent_id
at write time; remember with no explicit agent uses "default".
Per-file slot shared across every agent.
Implementations§
Source§impl KeyScope
impl KeyScope
Sourcepub const DEFAULT_AGENT: &'static str = "default"
pub const DEFAULT_AGENT: &'static str = "default"
Default agent id used when Memory::new(...) is called without
.with_agent(...) — same "default" the Memory::new
constructor seeds into Memory.agent_id.
Sourcepub fn private_default() -> Self
pub fn private_default() -> Self
Build the private slot for the default agent. Shorthand for
KeyScope::Private(KeyScope::DEFAULT_AGENT.to_string()).