Struct clingo::SolveHandle
[−]
[src]
pub struct SolveHandle<'a> { /* fields omitted */ }
Search handle to a solve call.
Methods
impl<'a> SolveHandle<'a>
[src]
pub fn get(&mut self) -> Result<SolveResult, ClingoError>
[src]
Get the next solve result.
Blocks until the result is ready. When yielding partial solve results can be obtained, i.e., when a model is ready, the result will be satisfiable but neither the search exhausted nor the optimality proven.
Errors
ErrorType::BadAlloc
ErrorType::Runtime
if solving fails
pub fn wait(&mut self, timeout: f64) -> bool
[src]
Wait for the specified amount of time to check if the next result is ready.
If the time is set to zero, this function can be used to poll if the search is still active. If the time is negative, the function blocks until the search is finished.
Arguments
timeout
- the maximum time to wait
Returns: whether the search has finished
pub fn model(&self) -> Result<&Model, Error>
[src]
Get the next model (or zero if there are no more models). (it is NULL if there are no more models)
Errors
ErrorType::BadAlloc
ErrorType::Runtime
if solving fails
pub fn model_mut(&mut self) -> Result<&mut Model, Error>
[src]
Get the next model (or zero if there are no more models). (it is NULL if there are no more models)
Errors
ErrorType::BadAlloc
ErrorType::Runtime
if solving fails
pub fn resume(&mut self) -> Result<(), ClingoError>
[src]
Discards the last model and starts the search for the next one.
If the search has been started asynchronously, this function continues the search in the background.
Note: This function does not block.
Errors
ErrorType::BadAlloc
ErrorType::Runtime
if solving fails
pub fn cancel(&mut self) -> Result<(), ClingoError>
[src]
Stop the running search and block until done.
Arguments
handle
- the target
Errors
ErrorType::BadAlloc
ErrorType::Runtime
if solving fails
pub fn close(self) -> Result<(), ClingoError>
[src]
Stops the running search and releases the handle.
Blocks until the search is stopped (as if an implicit cancel was called before the handle is released).
Errors
ErrorType::BadAlloc
ErrorType::Runtime
if solving fails