Struct AsyncHandle

Source
pub struct AsyncHandle(/* private fields */);
Expand description

A handle to an AsyncModel which is currently solving.

Implementations§

Source§

impl AsyncHandle

Source

pub fn status(&self) -> Result<Status>

Retrieve current the attr::Status of the model.

Source

pub fn obj_val(&self) -> Result<f64>

Retrieve the current attr::ObjVal of the model.

Source

pub fn obj_bnd(&self) -> Result<f64>

Retrieve the current attr::ObjBound of the model.

Source

pub fn iter_cnt(&self) -> Result<f64>

Retrieve the current attr::IterCount of the model.

Source

pub fn bar_iter_cnt(&self) -> Result<i32>

Retrieve the current attr::BarIterCount of the model.

Source

pub fn node_cnt(&self) -> Result<f64>

Retrieve the current attr::NodeCount of the model.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.