1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use core::objects::module::ModuleId;
use crate::base::Handler;
/// Return the identifier for this module.
pub trait ModuleIdentification: Sized {
/// Get the module identifier.
fn module_id(&self) -> ModuleId<'static>;
}
impl<T: Handler> ModuleIdentification for T {
fn module_id(&self) -> ModuleId<'static> {
self.contract().info().0
}
}