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

Method get_view_changes

atomic-repository/src/repository/insert.rs:3301–3319  ·  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

3299 /// }
3300 /// ```
3301 pub fn get_view_changes(
3302 &self,
3303 view_name: Option<&str>,
3304 ) -> Result<Vec<(u64, Hash)>, RepositoryError> {
3305 let txn = self
3306 .pristine
3307 .read_txn()
3308 .map_err(|e| RepositoryError::Database(e.to_string()))?;
3309
3310 let name = view_name.unwrap_or(&self.current_view);
3311 let view = txn
3312 .get_view(name)
3313 .map_err(|e| RepositoryError::Database(e.to_string()))?
3314 .ok_or_else(|| RepositoryError::ViewNotFound {
3315 name: name.to_string(),
3316 })?;
3317
3318 get_view_changes_fn(&txn, &view).map_err(|e| RepositoryError::Apply(e.to_string()))
3319 }
3320
3321 /// Get changes that are in one view but not another.
3322 ///

Calls 2

read_txnMethod · 0.80
get_viewMethod · 0.45