pub trait ExternalitiesExt {
    fn extension<T: Any + Extension>(&mut self) -> Option<&mut T>;
    fn register_extension<T: Extension>(&mut self, ext: T) -> Result<(), Error>;
    fn deregister_extension<T: Extension>(&mut self) -> Result<(), Error>;
}
Expand description

Extension for the Externalities trait.

Required Methods§

source

fn extension<T: Any + Extension>(&mut self) -> Option<&mut T>

Tries to find a registered extension and returns a mutable reference.

source

fn register_extension<T: Extension>(&mut self, ext: T) -> Result<(), Error>

Register extension ext.

Should return error if extension is already registered or extensions are not supported.

source

fn deregister_extension<T: Extension>(&mut self) -> Result<(), Error>

Deregister and drop extension of T type.

Should return error if extension of type T is not registered or extensions are not supported.

Implementors§