Hello,
How can I get a function signature of an imported library function? I'm currently trying to parse the source file using the "syn" crate (let syntax = syn::parse_file(&src).expect("Unable to parse file");) and do operations based on function's arguments types.
I need a generic way to do this, like how the rust-analyzer / rls help in code completion based on the imported / use functions.
For Ex: In the following code, how to get the function signature of "rsa.private_key_to_pem_passphrase"
extern crate openssl;
use openssl::rsa::Rsa;
use openssl::symm::Cipher;
fn main() {
let passphrase = "rust_by_example";
let rsa = Rsa::generate(1024).unwrap();
let private_key: Vec<u8> = rsa.private_key_to_pem_passphrase(Cipher::aes_128_cbc(), passphrase.as_bytes()).unwrap();
let public_key: Vec<u8> = rsa.public_key_to_pem().unwrap();
println!("Private key: {}", String::from_utf8(private_key).unwrap());
println!("Public key: {}", String::from_utf8(public_key).unwrap());
}
Thanks for your time.