pub struct IntentLibrary { /* private fields */ }Expand description
Named index for compiled intent artifacts.
The index stores CompiledIntent records, which point at normalized prose
and BRIDGE packet bytes by ContentId. It does not duplicate the packet or
prose content store; lookup is by intent name/version or by normalized
source id.
Implementations§
Source§impl IntentLibrary
impl IntentLibrary
Sourcepub fn store(&mut self, intent: CompiledIntent) -> Result<()>
pub fn store(&mut self, intent: CompiledIntent) -> Result<()>
Stores or updates an intent record at its explicit name/version key.
A packet change at an existing key is rejected because packet changes must become a new version. A stored golden record is immutable except for idempotent re-storage of the same record.
Sourcepub fn fetch(&self, name: &Symbol, version: u32) -> Option<&CompiledIntent>
pub fn fetch(&self, name: &Symbol, version: u32) -> Option<&CompiledIntent>
Fetches an intent by exact name and version.
Sourcepub fn by_source(&self, source: &ContentId) -> Vec<&CompiledIntent>
pub fn by_source(&self, source: &ContentId) -> Vec<&CompiledIntent>
Returns all intents whose normalized source id matches source.
Sourcepub fn golden_by_source(&self, source: &ContentId) -> Option<&CompiledIntent>
pub fn golden_by_source(&self, source: &ContentId) -> Option<&CompiledIntent>
Returns the highest-version golden intent for source, when one exists.
Sourcepub fn next_version(&self, name: &Symbol) -> u32
pub fn next_version(&self, name: &Symbol) -> u32
Returns the next version number available for name.
Trait Implementations§
Source§impl Clone for IntentLibrary
impl Clone for IntentLibrary
Source§fn clone(&self) -> IntentLibrary
fn clone(&self) -> IntentLibrary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more