jnix icon indicating copy to clipboard operation
jnix copied to clipboard

examples with more data type

Open derust opened this issue 3 years ago • 0 comments

I use the data struct in README, It works great.

But when I try to add more data type like Ipv4Addr and Vec , which implement FromJava already, none of them works.

// Rust type definition
#[derive(Default, FromJava, IntoJava)]
#[jnix(package = "my.package")]
pub struct MyData {
    number: i32,
    string: String,
    data: Vec<i32>,  // 
    addr: Ipv4Addr,
}
thread 'unnamed' panicked at 'Failed to get method ID for my.package.MyData::getAddr: Error(JavaException, State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })': src/lib.rs:9

derust avatar Mar 22 '21 16:03 derust