Skip to content

v0.8.1

Choose a tag to compare

@mmghannam mmghannam released this 08 May 15:59
· 84 commits to main since this release

Updates

  • In this version, you can now attach any data to the Model instance using the
    set_data method, and retrieve it using the get_data and get_data_mut methods.
    This is useful for communicating data between plugins, or storing other representations of the
    variables/constraints in the model.

     let mut model = Model::new();
     
     // Some user-defined data
     struct MyData {
         title: String,
     }
     
     let data = MyData {
         title: "My Data".to_string(),
     };
     
     // Attach the data to the model
     model.set_data(data);
     
     // Retrieve the data
     let data_ref = model.get_data::<MyData>().unwrap();
     assert_eq!(data_ref.title, "My Data");
     
     // Mutate the data
     let data_mut = model.get_data_mut::<MyData>().unwrap();
     data_mut.title = "New Title".to_string();
     assert_eq!(data_mut.title, "New Title");
  • This release also brings support to SCIP's diving and probing modes, through the start_diving and start_probing methods. Returning a Diver and Prober objects that allow access to methods only available in diving and probing modes respectively, where the mode is exited safely, when the corresponding object is dropped.

  • New ergonomic builder for the Row object through row() function.

What's Changed

Full Changelog: v0.8.0...v0.8.1