pub struct SymbolClaimTracker { /* private fields */ }Expand description
Thread-safe, lock-free tracker for symbol-level claims across sessions.
Key insight: two sessions modifying DIFFERENT symbols in the same file is NOT a conflict. Only same-symbol modifications across sessions are TRUE conflicts. This is dkod’s core differentiator over line-based VCS.
The tracker is keyed by (repo_id, file_path) and stores a Vec<SymbolClaim>
for each file. DashMap provides fine-grained per-shard locking so reads are
effectively lock-free when not contending on the same shard.
Implementations§
Source§impl SymbolClaimTracker
impl SymbolClaimTracker
Sourcepub fn record_claim(&self, repo_id: Uuid, file_path: &str, claim: SymbolClaim)
pub fn record_claim(&self, repo_id: Uuid, file_path: &str, claim: SymbolClaim)
Record a symbol claim. If the same session already claims the same
qualified_name in the same file, the existing claim is updated
(not duplicated).
Sourcepub fn check_conflicts(
&self,
repo_id: Uuid,
file_path: &str,
session_id: Uuid,
qualified_names: &[String],
) -> Vec<ConflictInfo>
pub fn check_conflicts( &self, repo_id: Uuid, file_path: &str, session_id: Uuid, qualified_names: &[String], ) -> Vec<ConflictInfo>
Check whether any of the given qualified_names are already claimed by
a session other than session_id. Returns a ConflictInfo for each
conflicting symbol.
Sourcepub fn get_all_conflicts_for_session(
&self,
repo_id: Uuid,
session_id: Uuid,
) -> Vec<(String, ConflictInfo)>
pub fn get_all_conflicts_for_session( &self, repo_id: Uuid, session_id: Uuid, ) -> Vec<(String, ConflictInfo)>
Return all conflicts for a given session across ALL file paths.
This checks every tracked file to find symbols where session_id has
a claim AND another session also claims the same symbol.
Sourcepub fn clear_session(&self, session_id: Uuid)
pub fn clear_session(&self, session_id: Uuid)
Remove all claims belonging to a session (e.g. on disconnect or GC).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SymbolClaimTracker
impl !RefUnwindSafe for SymbolClaimTracker
impl Send for SymbolClaimTracker
impl Sync for SymbolClaimTracker
impl Unpin for SymbolClaimTracker
impl UnsafeUnpin for SymbolClaimTracker
impl UnwindSafe for SymbolClaimTracker
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more