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

Method with_capacity

atomic-core/src/record/builder.rs:196–208  ·  view source on GitHub ↗

Create a builder with pre-allocated capacity. Use this when you know approximately how many actions and content bytes will be recorded. # Arguments `action_capacity` - Expected number of hunks `content_capacity` - Expected total content bytes # Example ```rust use atomic_core::record::RecordBuilder; // Pre-allocate for a large recording session let builder = RecordBuilder::with_capacity(100,

(action_capacity: usize, content_capacity: usize)

Source from the content-addressed store, hash-verified

194 /// let builder = RecordBuilder::with_capacity(100, 1024 * 1024);
195 /// ```
196 pub fn with_capacity(action_capacity: usize, content_capacity: usize) -> Self {
197 Self {
198 actions: Vec::with_capacity(action_capacity),
199 contents: Vec::with_capacity(content_capacity),
200 updatables: HashMap::with_capacity(action_capacity / 4),
201 recorded_inodes: HashMap::new(),
202 largest_file: 0,
203 has_binary_files: false,
204 oldest_change: SystemTime::UNIX_EPOCH,
205 force_rediff: false,
206 ignore_missing: false,
207 }
208 }
209
210 /// Check if no changes have been recorded.
211 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected