referrerpolicy=no-referrer-when-downgrade

Trait sp_core::traits::ExternalitiesExt

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

Extension for the Externalities trait.

Required Methods§

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

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

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

Register extension ext.

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

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

Deregister and drop extension of T type.

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

Object Safety§

This trait is not object safe.

Implementors§