pub struct AsyncHandle(/* private fields */);
Expand description
A handle to an AsyncModel
which is currently solving.
Implementations§
Source§impl AsyncHandle
impl AsyncHandle
Sourcepub fn bar_iter_cnt(&self) -> Result<i32>
pub fn bar_iter_cnt(&self) -> Result<i32>
Retrieve the current attr::BarIterCount
of the model.
Sourcepub fn join(self) -> (AsyncModel, Result<()>)
pub fn join(self) -> (AsyncModel, Result<()>)
Wait for optimisation to finish.
§Errors
An Error::FromAPI
may occur during optimisation, in which case it is stored in the Result
.
Sourcepub fn terminate(&self)
pub fn terminate(&self)
Send a request to Gurobi to terminate optimization. Optimization may not finish immediately.
§Example
use grb::AsyncModel;
let e = Env::new("")?;
let m = Model::with_env("async", e)?;
...
let m = AsyncModel::new(m);
// discard `AsyncModel` on failure and panic
let handle = m.optimize().map_err(|(_, e)| e).unwrap();
...
handle.terminate();
Auto Trait Implementations§
impl Freeze for AsyncHandle
impl RefUnwindSafe for AsyncHandle
impl !Send for AsyncHandle
impl !Sync for AsyncHandle
impl Unpin for AsyncHandle
impl UnwindSafe for AsyncHandle
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