MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_session_intent

Method get_session_intent

atomic-repository/src/repository/changes.rs:1829–1845  ·  view source on GitHub ↗

Get intent metadata for a provenance graph. Returns the intent entry when the graph carries a Goal node with intent `detail`, `None` otherwise.

(
        &self,
        provenance_hash: &Hash,
    )

Source from the content-addressed store, hash-verified

1827 /// Returns the intent entry when the graph carries a Goal node with intent
1828 /// `detail`, `None` otherwise.
1829 pub fn get_session_intent(
1830 &self,
1831 provenance_hash: &Hash,
1832 ) -> Result<Option<atomic_core::change::session::IntentEntry>, RepositoryError> {
1833 let txn = self
1834 .pristine
1835 .read_txn()
1836 .map_err(|e| RepositoryError::Database(e.to_string()))?;
1837 let provenance_id = txn
1838 .get_internal(provenance_hash)
1839 .map_err(|e| RepositoryError::Database(e.to_string()))?
1840 .ok_or_else(|| RepositoryError::ChangeNotFound {
1841 hash: provenance_hash.to_base32(),
1842 })?;
1843 txn.get_session_intent(provenance_id.get())
1844 .map_err(|e| RepositoryError::Database(e.to_string()))
1845 }
1846
1847 /// Check if a provenance graph has populated session data.
1848 ///

Callers

nothing calls this directly

Calls 4

read_txnMethod · 0.80
getMethod · 0.65
get_internalMethod · 0.45
to_base32Method · 0.45

Tested by

no test coverage detected