-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Java/JNICase specific only for Java/JNI interface generationCase specific only for Java/JNI interface generationquestion
Description
When I am trying to create callback with pointers, flapigen cannot convert &Type to java:
rust code:
#[generate_interface]
pub trait GetScoreCallback {
fn get_score(&mut self, network: &NeuralNetwork) -> f64;
}
generated interface:
foreign_callback!(
callback GetScoreCallback {
self_type GetScoreCallback;
getScore = GetScoreCallback::get_score(& mut self , network : & NeuralNetwork)->f64;
}
);
error:
parsing of java-api-for-rust: src/generated/java_glue.rs.in failed
error: Do not know conversion from such rust type '& NeuralNetwork' to Java type
getScore = GetScoreCallback::get_score(& mut self , network : & NeuralNetwork)->f64;
However, when I am using references wtih class method - it works:
pub struct Something;
impl Something {
#[generate_interface]
pub fn something(net: &NeuralNetwork) {}
}
foreign_class!(
class Something {
fn Something::something(net : & NeuralNetwork); alias something;
}
);
Copying network is a compute-intense process.
Is there any way to solve this problem without copying?
Metadata
Metadata
Assignees
Labels
Java/JNICase specific only for Java/JNI interface generationCase specific only for Java/JNI interface generationquestion