pub struct ActiveBorrowV2 {
pub borrower: VarId,
pub kind: BorrowKind,
pub start_line: u32,
pub end_line: Option<u32>,
}Expand description
Represents an active borrow of a variable (V2 - uses VarId).
Fields§
§borrower: VarIdThe variable that holds the borrow (the reference variable).
kind: BorrowKindThe kind of borrow.
start_line: u32Line where the borrow started.
end_line: Option<u32>Line where the borrow ended (None = still active).
Implementations§
Source§impl ActiveBorrowV2
impl ActiveBorrowV2
Sourcepub fn new(borrower: VarId, kind: BorrowKind, start_line: u32) -> Self
pub fn new(borrower: VarId, kind: BorrowKind, start_line: u32) -> Self
Create a new active borrow.
Sourcepub fn is_active_at(&self, line: u32) -> bool
pub fn is_active_at(&self, line: u32) -> bool
Check if this borrow is still active at the given line.
Sourcepub fn conflicts_with(&self, new_kind: BorrowKind, at_line: u32) -> bool
pub fn conflicts_with(&self, new_kind: BorrowKind, at_line: u32) -> bool
Check if this borrow conflicts with a new borrow.
Trait Implementations§
Source§impl Clone for ActiveBorrowV2
impl Clone for ActiveBorrowV2
Source§fn clone(&self) -> ActiveBorrowV2
fn clone(&self) -> ActiveBorrowV2
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 ActiveBorrowV2
impl Debug for ActiveBorrowV2
Source§impl PartialEq for ActiveBorrowV2
impl PartialEq for ActiveBorrowV2
Source§fn eq(&self, other: &ActiveBorrowV2) -> bool
fn eq(&self, other: &ActiveBorrowV2) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ActiveBorrowV2
impl StructuralPartialEq for ActiveBorrowV2
Auto Trait Implementations§
impl Freeze for ActiveBorrowV2
impl RefUnwindSafe for ActiveBorrowV2
impl Send for ActiveBorrowV2
impl Sync for ActiveBorrowV2
impl Unpin for ActiveBorrowV2
impl UnsafeUnpin for ActiveBorrowV2
impl UnwindSafe for ActiveBorrowV2
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