Struct salsa_2022::cycle::Cycle
source · [−]pub struct Cycle { /* private fields */ }
Expand description
Captures the participants of a cycle that occurred when executing a query.
This type is meant to be used to help give meaningful error messages to the user or to help salsa developers figure out why their program is resulting in a computation cycle.
It is used in a few ways:
- During cycle recovery, where it is given to the fallback function.
- As the panic value when an unexpected cycle (i.e., a cycle where one or more participants lacks cycle recovery information) occurs.
You can read more about cycle handling in the salsa book.
Implementations
sourceimpl Cycle
impl Cycle
sourcepub fn participant_keys(&self) -> impl Iterator<Item = DatabaseKeyIndex> + '_
pub fn participant_keys(&self) -> impl Iterator<Item = DatabaseKeyIndex> + '_
Iterate over the DatabaseKeyIndex
for each query participating
in the cycle. The start point of this iteration within the cycle
is arbitrary but deterministic, but the ordering is otherwise determined
by the execution.
sourcepub fn all_participants<DB: ?Sized + Database>(&self, db: &DB) -> Vec<String>
pub fn all_participants<DB: ?Sized + Database>(&self, db: &DB) -> Vec<String>
Returns a vector with the debug information for all the participants in the cycle.
Trait Implementations
sourceimpl Ord for Cycle
impl Ord for Cycle
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Cycle> for Cycle
impl PartialOrd<Cycle> for Cycle
sourcefn partial_cmp(&self, other: &Cycle) -> Option<Ordering>
fn partial_cmp(&self, other: &Cycle) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Cycle
impl StructuralEq for Cycle
impl StructuralPartialEq for Cycle
Auto Trait Implementations
impl RefUnwindSafe for Cycle
impl Send for Cycle
impl Sync for Cycle
impl Unpin for Cycle
impl UnwindSafe for Cycle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.