pub struct LifetimeTransitivity<'env> {
env: &'env LifetimeEnv,
visited: Vec<bool>,
out: Vec<&'env NamedLifetime>,
longer_or_shorter: LongerOrShorter,
}
Expand description
Collect all lifetimes that are either longer_or_shorter
Fields§
§env: &'env LifetimeEnv
§visited: Vec<bool>
§out: Vec<&'env NamedLifetime>
§longer_or_shorter: LongerOrShorter
Implementations§
source§impl<'env> LifetimeTransitivity<'env>
impl<'env> LifetimeTransitivity<'env>
sourcepub fn longer(env: &'env LifetimeEnv) -> Self
pub fn longer(env: &'env LifetimeEnv) -> Self
Returns a new LifetimeTransitivity
that finds all longer lifetimes.
sourcepub fn shorter(env: &'env LifetimeEnv) -> Self
pub fn shorter(env: &'env LifetimeEnv) -> Self
Returns a new LifetimeTransitivity
that finds all shorter lifetimes.
sourcepub fn longer_than(
env: &'env LifetimeEnv,
named: &NamedLifetime,
) -> Vec<&'env NamedLifetime>
pub fn longer_than( env: &'env LifetimeEnv, named: &NamedLifetime, ) -> Vec<&'env NamedLifetime>
Returns all the lifetimes longer than a provided NamedLifetime
.
sourcepub fn shorter_than(
env: &'env LifetimeEnv,
named: &NamedLifetime,
) -> Vec<&'env NamedLifetime>
pub fn shorter_than( env: &'env LifetimeEnv, named: &NamedLifetime, ) -> Vec<&'env NamedLifetime>
Returns all the lifetimes shorter than the provided NamedLifetime
.
sourcefn new(env: &'env LifetimeEnv, longer_or_shorter: LongerOrShorter) -> Self
fn new(env: &'env LifetimeEnv, longer_or_shorter: LongerOrShorter) -> Self
Returns a new LifetimeTransitivity
.
sourcepub fn visit(&mut self, named: &NamedLifetime)
pub fn visit(&mut self, named: &NamedLifetime)
Visits a lifetime, as well as all the nodes it’s transitively longer or
shorter than, depending on how the LifetimeTransitivity
was constructed.
sourcefn dfs(&mut self, index: usize)
fn dfs(&mut self, index: usize)
Performs depth-first search through the LifetimeEnv
created at construction
for all nodes longer or shorter than the node at the provided index,
depending on how the LifetimeTransitivity
was constructed.
sourcepub fn finish(self) -> Vec<&'env NamedLifetime>
pub fn finish(self) -> Vec<&'env NamedLifetime>
Returns the transitively reachable lifetimes.
Auto Trait Implementations§
impl<'env> Freeze for LifetimeTransitivity<'env>
impl<'env> RefUnwindSafe for LifetimeTransitivity<'env>
impl<'env> Send for LifetimeTransitivity<'env>
impl<'env> Sync for LifetimeTransitivity<'env>
impl<'env> Unpin for LifetimeTransitivity<'env>
impl<'env> UnwindSafe for LifetimeTransitivity<'env>
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