pub trait ExtensionStore {
    fn extension_by_type_id(&mut self, type_id: TypeId) -> Option<&mut dyn Any>;
    fn register_extension_with_type_id(
        &mut self,
        type_id: TypeId,
        extension: Box<dyn Extension>
    ) -> Result<(), Error>; fn deregister_extension_by_type_id(
        &mut self,
        type_id: TypeId
    ) -> Result<(), Error>; }
Expand description

Something that provides access to the Extensions store.

This is a super trait of the Externalities.

Required Methods§

Tries to find a registered extension by the given type_id and returns it as a &mut dyn Any.

It is advised to use ExternalitiesExt::extension instead of this function to get type system support and automatic type downcasting.

Register extension extension with specified type_id.

It should return error if extension is already registered.

Deregister extension with speicifed ‘type_id’ and drop it.

It should return error if extension is not registered.

Implementors§

impl<'a, H, B> ExtensionStore for Ext<'a, H, B>where
    H: Hasher,
    B: 'a + Backend<H>,

impl<'a, H: Hasher, B: 'a + Backend<H>> ExtensionStore for ReadOnlyExternalities<'a, H, B>

impl<H> ExtensionStore for TestExternalities<H>where
    H: Hasher,
    H::Out: Ord + Codec,