Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
wasmify-sophia : Add exported methods

wasm_bindgen_dataset!(TreedDataset, "TreedDataset", SophiaExportDataset);

+use crate::wrapping::*;
+impl SophiaExportDataset {
+    pub fn get_nb_underlying(&self) -> usize {
+        self.base.dataset().get_number_of_underlying_trees()
+    }

And that's it.


  • The third argument is the name of the class that will be exported
  • Rust enables you to define multiple impl block
  • base is the adapter, base.dataset() is the Sophia compliant dataset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment