INNER CODE UNIT · Rust

hello

xoriors/rencfs · java-bridge/src/lib.rs:80

fn hello(name: &str) -> String {
    format!("Hello {name} from Rust!")
}

/// Test function that takes a string and returns it with some additional one.
#[allow(non_snake_case)]
#[no_mangle]
pub extern "system" fn Java_RustLibrary_hello(
    // Java environment.
    mut env: JNIEnv,
    // Static class which owns this method.
    _class: JClass,
    // The string which must be sorted
    name: JString,
) -> jstring {
    let name: String = env.get_string(&name).unwrap().into();

    let result = hello(&name);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…