async-debug-derive 0.1.3

Derive macro for async-debug: Debug structs and enums containing values that require an async call to render
Documentation
use bae::FromAttributes;
use convert_case::{Case, Casing};
use proc_macro2::{Ident, Span};
use syn::{Error, Expr, Type};

pub trait ErrorCallSite {
    fn new_call_site<T>(message: T) -> Error
    where
        T: std::fmt::Display;
}

impl ErrorCallSite for Error {
    fn new_call_site<T>(message: T) -> Error
    where
        T: std::fmt::Display,
    {
        Error::new(Span::call_site(), message)
    }
}

pub trait AsyncDebugCommon {
    fn get_async_debug_mod_ident(ident: &Ident) -> Ident {
        Ident::new(
            &format!("async_debug_{}", ident.to_string().to_case(Case::Snake)),
            ident.span(),
        )
    }
}

#[derive(FromAttributes)]
pub struct AsyncDebug {
    pub async_call: Option<Expr>,
    pub clone: Option<()>,
    pub copy: Option<()>,
    pub ty: Option<Type>,
}