Hello
I have a huge problem understanding the standard documentation of Rust crates. They just give a list of all the structs they use and all the available functions. But that often doesn't really help me further.
Without an example, I personally find it impossible to implement something.
For example. I now want to use the function last_insert_id()
from the MySQL-crate. I have found the function on this page.
Yet, I have no clue on how I'd use this function now. Instead of asking how to do x for every small thing, I'd like to learn how to read these documentations.
So, if someone could explain me on how to read this documentation and how to use the last_insert_id()
function it'd be great!
Relevant piece of code:
let execute_result = conn.exec_drop(r"
INSERT INTO users (
username, email, birthdate, password
) VALUES (
:username, :email, :birthdate, :password
)", params! {
"username" => &data.username,
"email" => data.email,
"birthdate" => date.format("%Y-%m-%d").to_string(),
"password" => data.password
});
PS.
Found on how to get the last_insert_id.
self.conn.get_conn().unwrap().last_insert_id();
Not due to the documentation though.