Añade función para crear handler único al compilar

Permite asignar automáticamente el "handler" a componentes, módulos,
temas y acciones.
This commit is contained in:
Manuel Cillero 2022-07-26 20:57:32 +02:00
parent 53668b8719
commit b986bfcd13
33 changed files with 156 additions and 111 deletions

View file

@ -1,6 +1,6 @@
use pagetop::prelude::*;
pub const MODULE_USER: &str = "pagetop-user::module::user";
pub_const_handler!(MODULE_USER);
localize!("src/locales");
@ -9,7 +9,7 @@ mod migration;
pub struct User;
impl ModuleTrait for User {
fn handler(&self) -> &'static str {
fn handler(&self) -> Handler {
MODULE_USER
}