Macro rquickjs_core::generic_loader[][src]

macro_rules! generic_loader {
    ($($(#[$meta:meta])* $type:ident $(<$($param:ident),*>)*: $kind:ident $({ $($bound:tt)* })*,)*) => { ... };
}
This is supported on crate feature loader only.

The helper macro to impl Loader traits for generic module kind.

generic_loader! {
    // Without bounds and metas
    // The `Loader<Script>` trait should be implemented for `MyScriptLoader`
    MyScriptLoader: Script,

    // With bounds and metas
    // The `Loader<Native>` trait should be implemented for `MyModuleLoader<T>`
    /// My loader doc comment
    #[cfg(feature = "my-module-loader")]
    MyModuleLoader<T>: Native {
        T: Loader<Native>,
    },
}