pub struct SyncMapping { /* private fields */ }Expand description
Mapping between Heddle StateIds and Git commit object IDs.
Implementations§
Source§impl SyncMapping
impl SyncMapping
Sourcepub fn insert_checked(
&mut self,
state_id: StateId,
git_oid: ObjectId,
) -> GitProjectionResult<()>
pub fn insert_checked( &mut self, state_id: StateId, git_oid: ObjectId, ) -> GitProjectionResult<()>
Insert a mapping and detect conflicts.
Sourcepub fn get_git(&self, state_id: &StateId) -> Option<ObjectId>
pub fn get_git(&self, state_id: &StateId) -> Option<ObjectId>
Get Git object id for a Heddle StateId.
Sourcepub fn get_heddle(&self, git_oid: ObjectId) -> Option<StateId>
pub fn get_heddle(&self, git_oid: ObjectId) -> Option<StateId>
Get Heddle StateId for a Git object id.
Sourcepub fn has_heddle(&self, state_id: &StateId) -> bool
pub fn has_heddle(&self, state_id: &StateId) -> bool
Check if a mapping exists for a StateId.
Sourcepub fn remove(&mut self, state_id: &StateId) -> Option<ObjectId>
pub fn remove(&mut self, state_id: &StateId) -> Option<ObjectId>
Drop the mapping for state_id, clearing both directions. Returns the
Git OID that was mapped, if any.
The export visibility purge calls this to remove a state whose
effective tier is no longer served by the export audience. Without it,
a stale StateId→OID mapping (minted while the state was public, kept
alive by the notes/cache rebuild on the next export) makes the
frontier walk and the tag/note sync treat a now-embargoed commit as
served — leaking it via refs/heads/<thread> or a tag.
Sourcepub fn has_git(&self, git_oid: ObjectId) -> bool
pub fn has_git(&self, git_oid: ObjectId) -> bool
Check if a mapping exists for a Git object id.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the in-memory mapping holds no StateId → git OID entries. The
checkout-materialization path (#568 P1) uses this to decide whether it must
hydrate the mapping from disk (a standalone projection checkout) or trust
the mapping export just built in memory (a checkpoint/push).
pub fn retain_git_objects(&mut self, repo: &SleyRepository)
pub fn retain_git_object_set(&mut self, reachable: &HashSet<ObjectId>) -> usize
Trait Implementations§
Source§impl Clone for SyncMapping
impl Clone for SyncMapping
Source§fn clone(&self) -> SyncMapping
fn clone(&self) -> SyncMapping
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more