You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: note.rs
    path of file: ./repos/sea-orm/examples/graphql_example/api/src/graphql/mutation
    
    the code of the file until where you have to start completion: use async_graphql::{Context, Object, Result};
use entity::async_graphql::{self, InputObject, SimpleObject};
use entity::note;
use graphql_example_service::Mutation;

use crate::db::Database;

// I normally separate the input types into separate files
    
    pub async fn delete_note(&self, ctx: &Context<'_>, id: i32) -> Result<DeleteResult> {
        let db = ctx.data::<Database>().unwrap();
        let conn = db.get_connection();

        let res = Mutation::delete_note(conn, id)
            .await
            .expect("Cannot delete note");

        if res.rows_affected <= 1 {
            Ok(DeleteResult {
                success: true,
                rows_affected: res.rows_affected,
            })
        } else {
            unimplemented!()
        }
    }