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§
source§impl 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§
source§impl Ord for Cycle
impl Ord for Cycle
source§impl PartialEq for Cycle
impl PartialEq for Cycle
source§impl PartialOrd for Cycle
impl PartialOrd for Cycle
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 StructuralPartialEq for Cycle
Auto Trait Implementations§
impl Freeze for Cycle
impl RefUnwindSafe for Cycle
impl Send for Cycle
impl Sync for Cycle
impl Unpin for Cycle
impl UnwindSafe for Cycle
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.