macro_rules! fn_param_error { ( $param:ident, $kind:expr ) => { $crate::Error(&$crate::error_macros::FnContext { parameter: Some(stringify!($param)), .._THINDX_FN_CONTEXT }, ($kind).into()) } }
macro_rules! fn_context {
( $thindx:path ) => {
const _THINDX_FN_CONTEXT : $crate::error_macros::FnContext = $crate::error_macros::FnContext { directx_method: None,
thindx_method: stringify!($thindx),
parameter: None,
module_path: std::module_path!(),
file: std::file!(),
line: std::line!(),
column: std::column!(),
};
};
( $thindx:path => $directx:path ) => {
const _THINDX_FN_CONTEXT : $crate::error_macros::FnContext = $crate::error_macros::FnContext { directx_method: Some(stringify!($directx)),
thindx_method: stringify!($thindx),
parameter: None,
module_path: std::module_path!(),
file: std::file!(),
line: std::line!(),
column: std::column!(),
};
};
}
#[allow(dead_code)] pub(crate) struct FnContext {
pub directx_method: Option<&'static str>,
pub thindx_method: &'static str,
pub parameter: Option<&'static str>,
pub module_path: &'static str,
pub file: &'static str,
pub line: u32,
pub column: u32,
}
#[test] fn asdf() {
fn_context! { thindx::method => Method };
}