pub struct WriteOptions {
pub silent: bool,
pub assume_loose_only_existence: bool,
pub trust_new_loose: bool,
pub loose_prefix_dirs_ready: bool,
pub freshen_existing: bool,
}Expand description
Options for Odb::write_with_options.
Fields§
§silent: boolWhen set, do not touch mtimes on existing objects (Git WRITE_OBJECT_SILENT).
assume_loose_only_existence: boolWhen set, skip the full Odb::exists scan (packs/alternates) and only
test for a loose file in this repository’s object directory before writing.
Bulk staging of new worktree blobs uses this so each insert does not walk every pack on a miss.
trust_new_loose: boolWhen set, skip existence probes and write when the loose path is absent
(bulk add of all-new blobs). Self::freshen_existing still applies.
loose_prefix_dirs_ready: boolWhen set, skip create_dir_all on the loose prefix directory (call
Odb::ensure_all_loose_prefix_dirs first).
freshen_existing: boolWhen set and no loose copy exists in this repository’s object directory, freshen a copy stored in a local pack (promisor packs included) or in an alternate object directory, and skip the write when that succeeds (Git freshens before writing).
Packs are looked up in the cached pack listing; a miss does not rescan
objects/pack/, so many probes for new objects stay cheap. An object stored only
where it cannot be freshened (a cruft pack) is still written loose. Like the pack
hits of Self::assume_loose_only_existence, the copy is freshened even when
Self::silent is set.
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
impl Copy for WriteOptions
Source§impl Debug for WriteOptions
impl Debug for WriteOptions
Source§impl Default for WriteOptions
impl Default for WriteOptions
impl Eq for WriteOptions
Source§impl PartialEq for WriteOptions
impl PartialEq for WriteOptions
impl StructuralPartialEq for WriteOptions
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnsafeUnpin for WriteOptions
impl UnwindSafe for WriteOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.