pub struct LifetimeRelation {
pub borrower_id: String,
pub borrowed_id: String,
pub start_time: u64,
pub end_time: Option<u64>,
pub is_mutable: bool,
}Expand description
A lifetime relationship between a borrower and borrowed variable.
Fields§
§borrower_id: StringID of the borrowing variable
borrowed_id: StringID of the borrowed variable
start_time: u64Timestamp when borrow started
end_time: Option<u64>Timestamp when borrow ended (None if still active)
is_mutable: boolWhether this is a mutable borrow
Implementations§
Source§impl LifetimeRelation
impl LifetimeRelation
Sourcepub fn new(
borrower_id: String,
borrowed_id: String,
start_time: u64,
is_mutable: bool,
) -> Self
pub fn new( borrower_id: String, borrowed_id: String, start_time: u64, is_mutable: bool, ) -> Self
Create a new lifetime relation.
Sourcepub fn overlaps_with(&self, other: &LifetimeRelation) -> bool
pub fn overlaps_with(&self, other: &LifetimeRelation) -> bool
Check if this lifetime overlaps with another.
Useful for detecting potential borrow conflicts.
Trait Implementations§
Source§impl Clone for LifetimeRelation
impl Clone for LifetimeRelation
Source§fn clone(&self) -> LifetimeRelation
fn clone(&self) -> LifetimeRelation
Returns a duplicate of the value. Read more
1.0.0 · 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 LifetimeRelation
impl Debug for LifetimeRelation
Source§impl<'de> Deserialize<'de> for LifetimeRelation
impl<'de> Deserialize<'de> for LifetimeRelation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LifetimeRelation
impl PartialEq for LifetimeRelation
Source§impl Serialize for LifetimeRelation
impl Serialize for LifetimeRelation
impl StructuralPartialEq for LifetimeRelation
Auto Trait Implementations§
impl Freeze for LifetimeRelation
impl RefUnwindSafe for LifetimeRelation
impl Send for LifetimeRelation
impl Sync for LifetimeRelation
impl Unpin for LifetimeRelation
impl UnwindSafe for LifetimeRelation
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