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: result.rs
    path of file: ./repos/diesel/diesel/src
    
    the code of the file until where you have to start completion: //! Errors, type aliases, and functions related to working with `Result`.

use std::error::Error as StdError;
use std::ffi::NulError;
use std::fmt::{self, Display};

#[derive(Debug)]
#[allow(clippy::enum_variant_names)]
/// Represents all the ways that a query can fail.
///
/// This type is not intended to be exhaustively matched, and new variants may
/// be added in the future without a major version bump.
#[non_exhaustive]
pub enum Error {
    /// The query contained 
    
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match *self {
            Error::InvalidCString(ref nul_err) => write!(f, "{nul_err}"),
            Error::DatabaseError(_, ref e) => write!(f, "{}", e.message()),
            Error::NotFound => f.write_str("Record not found"),
            Error::QueryBuilderError(ref e) => e.fmt(f),
            Error::DeserializationError(ref e) => e.fmt(f),
            Error::SerializationError(ref e) => e.fmt(f),
            Error::RollbackErrorOnCommit {
                ref rollback_error,
                ref commit_error,
            } => {
                write!(
                    f,
                    "Transaction rollback failed: {} \
                        (rollback attempted because of failure to commit: {})",
                    &**rollback_error, &**commit_error
                )?;
                Ok(())
            }
            Error::RollbackTransaction => {
                write!(f, "You have asked diesel to rollback the transaction")
            }
            Error::BrokenTransactionManager => write!(f, "The transaction manager is broken"),
            Error::AlreadyInTransaction => write!(
                f,
                "Cannot perform this operation while a transaction is open",
            ),
            Error::NotInTransaction => {
                write!(f, "Cannot perform this operation outside of a transaction",)
            }
        }
    }