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: error.rs
    path of file: ./repos/ouch/src
    
    the code of the file until where you have to start completion: //! Error types definitions.
//!
//! All usage errors will pass through the Error enum, a lot of them in the Error::Custom.

use std::{
    borrow::Cow,
    fmt::{self, Display},
};

use crate::{accessible::is_running_in_accessible_mode, utils::colors::*};

/// All errors that can be generated by `ouch`
#[derive(Debug)]
pub enum Error {
    /// Not every IoError, some of them get filtered by `From<io::Error>` into other variants
    IoError { reason: String },
    /// From lzzzz::lz4f::Error
    Lz4Error { reason: String },
    /// Detected from io::Error if .kind() is io::ErrorKind::NotFound
    NotFound { error_title: String },
    /// NEEDS MORE CONTEXT
    AlreadyExists { error_title: String },
    /// From zip::result::ZipError::InvalidArchive
    InvalidZipArchive(&'static str),
    /// Detected from io::Error if .kind() is io::ErrorKind::PermissionDenied
    PermissionDenied { error_title: String },
    /// From zip::result::Z
    
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        let err = match self {
            Error::WalkdirError { reason } => FinalError::with_title(reason.to_string()),
            Error::NotFound { error_title } => FinalError::with_title(error_title.to_string()).detail("File not found"),
            Error::CompressingRootFolder => {
                FinalError::with_title("It seems you're trying to compress the root folder.")
                    .detail("This is unadvisable since ouch does compressions in-memory.")
                    .hint("Use a more appropriate tool for this, such as rsync.")
            }
            Error::IoError { reason } => FinalError::with_title(reason.to_string()),
            Error::Lz4Error { reason } => FinalError::with_title(reason.to_string()),
            Error::AlreadyExists { error_title } => {
                FinalError::with_title(error_title.to_string()).detail("File already exists")
            }
            Error::InvalidZipArchive(reason) => FinalError::with_title("Invalid zip archive").detail(*reason),
            Error::PermissionDenied { error_title } => {
                FinalError::with_title(error_title.to_string()).detail("Permission denied")
            }
            Error::UnsupportedZipArchive(reason) => FinalError::with_title("Unsupported zip archive").detail(*reason),
            Error::InvalidFormat { reason } => FinalError::with_title("Invalid archive format").detail(reason.clone()),
            Error::Custom { reason } => reason.clone(),
            Error::SevenzipError(reason) => FinalError::with_title("7z error").detail(reason.to_string()),
            Error::UnsupportedFormat { reason } => {
                FinalError::with_title("Recognised but unsupported format").detail(reason.clone())
            }
        };

        write!(f, "{err}")
    }