pub struct BorrowTrackerV2 { /* private fields */ }Expand description
Tracks active borrows for a set of variables (V2 - uses VarId).
Integrates with DataFlowGraphV2 for borrow conflict detection.
Implementations§
Source§impl BorrowTrackerV2
impl BorrowTrackerV2
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create with pre-allocated capacity.
Sourcepub fn add_borrow(
&mut self,
source: VarId,
borrower: VarId,
kind: BorrowKind,
line: u32,
) -> Vec<BorrowConflict>
pub fn add_borrow( &mut self, source: VarId, borrower: VarId, kind: BorrowKind, line: u32, ) -> Vec<BorrowConflict>
Add a borrow.
Returns any conflicts with existing borrows.
Sourcepub fn end_borrow(&mut self, borrower: VarId, line: u32)
pub fn end_borrow(&mut self, borrower: VarId, line: u32)
End a borrow.
Sourcepub fn conflicts(
&self,
source: VarId,
kind: BorrowKind,
at_line: u32,
) -> Vec<BorrowConflict>
pub fn conflicts( &self, source: VarId, kind: BorrowKind, at_line: u32, ) -> Vec<BorrowConflict>
Query conflicts with a potential new borrow.
Sourcepub fn active_borrows_at(
&self,
source: VarId,
line: u32,
) -> Vec<&ActiveBorrowV2>
pub fn active_borrows_at( &self, source: VarId, line: u32, ) -> Vec<&ActiveBorrowV2>
Get all active borrows of a variable at a given line.
Sourcepub fn active_borrows(&self, source: VarId) -> &[ActiveBorrowV2]
pub fn active_borrows(&self, source: VarId) -> &[ActiveBorrowV2]
Get all active borrows of a variable (regardless of line).
Sourcepub fn has_active_borrows(&self, source: VarId, at_line: u32) -> bool
pub fn has_active_borrows(&self, source: VarId, at_line: u32) -> bool
Check if any borrows are currently active for a variable.
Sourcepub fn has_active_mut_borrow(&self, source: VarId, at_line: u32) -> bool
pub fn has_active_mut_borrow(&self, source: VarId, at_line: u32) -> bool
Check if a mutable borrow is active for a variable.
Sourcepub fn tracked_var_count(&self) -> usize
pub fn tracked_var_count(&self) -> usize
Get the number of tracked variables.
Sourcepub fn total_borrow_count(&self) -> usize
pub fn total_borrow_count(&self) -> usize
Get the total number of borrows (active and ended).
Trait Implementations§
Source§impl Clone for BorrowTrackerV2
impl Clone for BorrowTrackerV2
Source§fn clone(&self) -> BorrowTrackerV2
fn clone(&self) -> BorrowTrackerV2
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BorrowTrackerV2
impl Debug for BorrowTrackerV2
Source§impl Default for BorrowTrackerV2
impl Default for BorrowTrackerV2
Source§fn default() -> BorrowTrackerV2
fn default() -> BorrowTrackerV2
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BorrowTrackerV2
impl RefUnwindSafe for BorrowTrackerV2
impl Send for BorrowTrackerV2
impl Sync for BorrowTrackerV2
impl Unpin for BorrowTrackerV2
impl UnsafeUnpin for BorrowTrackerV2
impl UnwindSafe for BorrowTrackerV2
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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