Skip to main content

MoveGuard

Trait MoveGuard 

Source
pub trait MoveGuard {
    // Required method
    fn accept_move(&self, entity: usize, from: usize, labels: &[usize]) -> bool;
}
Expand description

Veto individual moves after they’ve been picked by the sweep.

Called once per proposed accepted move (from != to) before the move is applied to the sufficient statistics. For the two moves of an exchange between two blocks, the second is asked about with the first already applied, and the first is undone if the second is vetoed. The destination label is intentionally not passed — guards so far only need the source cluster (e.g. articulation tests ask “does removing this entity disconnect from?”). Add a destination-aware variant if a concrete use case surfaces.

Required Methods§

Source

fn accept_move(&self, entity: usize, from: usize, labels: &[usize]) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§