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

Method get_view_changes

atomic-repository/src/repository/insert.rs:3251–3269  ·  view source on GitHub ↗

Get all changes inserted into a view. Returns changes in order from oldest (sequence 0) to newest. # Arguments `view_name` - Name of the view to query (None = current view) # Returns Vector of (sequence, hash) pairs. # Example ```rust,ignore let changes = repo.get_view_changes(None)?; for (seq, hash) in changes { println!("#{}: {}", seq, hash.to_base32()); } ```

(
        &self,
        view_name: Option<&str>,
    )

Source from the content-addressed store, hash-verified

3249 /// }
3250 /// ```
3251 pub fn get_view_changes(
3252 &self,
3253 view_name: Option<&str>,
3254 ) -> Result<Vec<(u64, Hash)>, RepositoryError> {
3255 let txn = self
3256 .pristine
3257 .read_txn()
3258 .map_err(|e| RepositoryError::Database(e.to_string()))?;
3259
3260 let name = view_name.unwrap_or(&self.current_view);
3261 let view = txn
3262 .get_view(name)
3263 .map_err(|e| RepositoryError::Database(e.to_string()))?
3264 .ok_or_else(|| RepositoryError::ViewNotFound {
3265 name: name.to_string(),
3266 })?;
3267
3268 get_view_changes_fn(&txn, &view).map_err(|e| RepositoryError::Apply(e.to_string()))
3269 }
3270
3271 /// Get changes that are in one view but not another.
3272 ///

Calls 2

read_txnMethod · 0.80
get_viewMethod · 0.45