Trait gpp_solver::Problem [−][src]
pub trait Problem {
type Error;
fn direct_dependencies<'life0, 'life1, 'async_trait>(
&'life0 self,
id: FragmentId,
dependecies: &'life1 mut Vec<FragmentId>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>ⓘ
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn evaluate<'life0, 'async_trait>(
&'life0 self,
id: FragmentId
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>ⓘ
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Trait implemented by objects that define a specific problem to be solved by the Solver
.
Use async_trait
to implement this trait.
Associated Types
Error type for Problem::evaluate
.
Required methods
fn direct_dependencies<'life0, 'life1, 'async_trait>(
&'life0 self,
id: FragmentId,
dependecies: &'life1 mut Vec<FragmentId>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn direct_dependencies<'life0, 'life1, 'async_trait>(
&'life0 self,
id: FragmentId,
dependecies: &'life1 mut Vec<FragmentId>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>ⓘ where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Fill dependencies
with the direct dependencies of id
. The output vector is guaranteed
to be empty when this method is called.
Called by the solver to signal that a fragment has had all of its dependencies evaluated and thus the fragment should be evaluated too.
See Solver::run
and Solver::step
on how evaluation failures are handled.
This method is never called more than once with the same fragment.