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

Method with_capacity

atomic-repository/src/status.rs:477–489  ·  view source on GitHub ↗

Create a repository status with pre-allocated capacity. # Arguments `view` - The current view name `state` - The Merkle state of the view `capacity` - Expected number of entries

(view: String, state: Option<Merkle>, capacity: usize)

Source from the content-addressed store, hash-verified

475 /// * `state` - The Merkle state of the view
476 /// * `capacity` - Expected number of entries
477 pub fn with_capacity(view: String, state: Option<Merkle>, capacity: usize) -> Self {
478 Self {
479 view,
480 state,
481 entries: Vec::with_capacity(capacity),
482 path_index: HashMap::with_capacity(capacity),
483 stale_index_count: 0,
484 verified_candidate_root: None,
485 change_source_fallback: None,
486 change_source_metrics: None,
487 notices: Vec::new(),
488 }
489 }
490
491 /// Get the current view name.
492 pub fn view(&self) -> &str {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected