pub struct LifetimeScope { /* private fields */ }Expand description
Tracks lifetime information for variables in the current scope
Implementations§
Source§impl LifetimeScope
impl LifetimeScope
pub fn new() -> Self
Sourcepub fn set_lifetime(&mut self, var: String, lifetime: String)
pub fn set_lifetime(&mut self, var: String, lifetime: String)
Assign a lifetime to a variable
Sourcepub fn mark_owned(&mut self, var: String)
pub fn mark_owned(&mut self, var: String)
Mark a variable as owned (not a reference)
Sourcepub fn get_lifetime(&self, var: &str) -> Option<&String>
pub fn get_lifetime(&self, var: &str) -> Option<&String>
Get the lifetime of a variable
Sourcepub fn add_constraint(&mut self, constraint: LifetimeBound)
pub fn add_constraint(&mut self, constraint: LifetimeBound)
Add a lifetime constraint
Sourcepub fn check_outlives(&self, longer: &str, shorter: &str) -> bool
pub fn check_outlives(&self, longer: &str, shorter: &str) -> bool
Check if lifetime ’a outlives lifetime ’b
Trait Implementations§
Source§impl Clone for LifetimeScope
impl Clone for LifetimeScope
Source§fn clone(&self) -> LifetimeScope
fn clone(&self) -> LifetimeScope
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 moreAuto Trait Implementations§
impl Freeze for LifetimeScope
impl RefUnwindSafe for LifetimeScope
impl Send for LifetimeScope
impl Sync for LifetimeScope
impl Unpin for LifetimeScope
impl UnwindSafe for LifetimeScope
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