Rust Metasploit is a rust library used to make communication with Metasploit RPC Server.This module uses reqwest and rmp dependencies for communication.
Let's have a glance at a simple code
rust
use metasploit::client::Client;
let client=Client::new("127.0.0.1",55552,"user","password",true);
print(client.gettoken());
Metasploit RPC can be setup two ways
msfrpcd -U <username> -P <password> -p <port> -a <IP Address>
For example
msfrpcd -U user -P password -p 55552 -a 127.0.0.1
msf6 > load msgrpc Pass=<password> Username=<username>
For example
msf6 > load msgrpc Pass=password Username=user
When you start metasploit RPC Server from console,the ssl value should be false.Like,
rust
let client=Client::new("127.0.0.1",55552,"user","password",false);
All details about the library have been written in docs.rs