ControlCtx

Trait ControlCtx 

Source
pub trait ControlCtx {
    type L: Logger;
    type P: Propagator;
    type O: GroundProgramObserver;
    type F: FunctionHandler;

    // Required methods
    fn logger(&mut self) -> (&mut Self::L, u32);
    fn propagator(&mut self) -> (&mut Self::P, bool);
    fn observer(&mut self) -> (&mut Self::O, bool);
    fn function_handler(&mut self) -> &mut Self::F;
}
Expand description

An instance of this trait can be registered with a control object to enable logging, custom propagation, observers and function handling.

See: control_with_context()

Required Associated Types§

Required Methods§

Source

fn logger(&mut self) -> (&mut Self::L, u32)

Return a logger and the maximum number of times the logger callback is called

Source

fn propagator(&mut self) -> (&mut Self::P, bool)

Return a propagator and boolean flag sequential

If the sequential flag is true, the propagator is called sequentially when solving with multiple threads.

Source

fn observer(&mut self) -> (&mut Self::O, bool)

Return a program observer and boolean flag for replace

If the replace flag is true, the grounding is passed to the observer but not the solver

Source

fn function_handler(&mut self) -> &mut Self::F

Return a function handler

Implementors§