Trait sp_core::traits::ExternalitiesExt[][src]

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

Extension for the Externalities trait.

Required methods

pub fn extension<T>(&mut self) -> Option<&mut T> where
    T: Extension + Any
[src]

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

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

Register extension ext.

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

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

Deregister and drop extension of T type.

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

Loading content...

Implementors

impl<'_> ExternalitiesExt for &'_ mut (dyn Externalities + '_)[src]

Loading content...