sp_externalities

Macro decl_extension

Source
macro_rules! decl_extension {
    (
		$( #[ $attr:meta ] )*
		$vis:vis struct $ext_name:ident ($inner:ty);
	) => { ... };
    (
		$( #[ $attr:meta ] )*
		$vis:vis struct $ext_name:ident;
	) => { ... };
}
Expand description

Macro for declaring an extension that usable with Extensions.

The extension will be an unit wrapper struct that implements Extension, Deref and DerefMut. The wrapped type is given by the user.

ยงExample

decl_extension! {
    /// Some test extension
    struct TestExt(String);
}