What is the intended way to handle errors from insert/update using the rust driver?

I notice many helpful examples for the rust driver here, it for the most part has examples for almost everything I want to do:

Unless I missed it, none of the examples describe how to handle the result of using session.query to insert or update except for just throwing it upwards. I am trying to work out the best way to read the result of an insert/update and do different things depending on the result.

In the documentation, I notice that the query() function does contain some helper functions like rows() or rows_or_none() and things like that. But nothing obvious regarding explicitly checking the results of an insert/update.

I need to check that the update reached the server and the server indicated that the update succeeded. But the sample code seems to ignore error handling for the most part, i.e.

// Sending three integers using a slice:
session
    .query("INSERT INTO ks.tab (a, b, c) VALUES(?, ?, ?)", [1_i32, 2, 3].as_ref())
    .await?;

What is the best way to capture if the query definitely failed? I can see this in the source of the driver:

pub fn result_not_rows(&self) -> Result<(), RowsNotExpectedError> {
        match self.rows {
            Some(_) => Err(RowsNotExpectedError),
            None => Ok(()),
        }
    }

But this seems to be designed to do something assuming the query was successful, but the response was not what was expected?

UPDATE Never mind, I worked it out in the end. It’d be neat to see some examples of handling errors at some point.

    match c
        .session
        .query(
            "update app_key set used=0 where os = ? and key = ?",
            (&os, &key, 0),
        )
        .await
    {
        Ok(..) => {
            // Do other stuff
        }
        Err(e) => {
            // Do special stuff
            println!("insert failed: {:?}", e);
            return Err(Message::WriteRowFailed);
        }
    }