Skip to content

Commit

Permalink
Fix rust bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
olafmersmann committed Oct 24, 2023
1 parent 1b71b3b commit e4cf9a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code-experiments/build/rust/src/observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use coco_sys::coco_observer_t;
use std::ffi::{CStr, CString};

use crate::Problem;

/// Observers provided by COCO.
///
/// The observer name should match the [`suite::Name`](crate::suite::Name).
Expand Down Expand Up @@ -91,6 +93,13 @@ impl Observer {
.unwrap()
}
}

/// Signal an internal restart of the optimizer to the observer
pub fn signal_restart(&self, problem: &Problem) {
unsafe {
coco_sys::coco_observer_signal_restart(self.inner, problem.inner);
}
}
}

impl Drop for Observer {
Expand Down

0 comments on commit e4cf9a0

Please sign in to comment.