Trait Extension

pub trait Extension: Send + 'static {
    // Required methods
    fn as_mut_any(&mut self) -> &mut (dyn Any + 'static);
    fn type_id(&self) -> TypeId;
}
Expand description

Export pallets that are used in crate::create_sandbox Marker trait for types that should be registered as Externalities extension.

As extensions are stored as Box<Any>, this trait should give more confidence that the correct type is registered and requested.

Required Methods§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

Return the extension as &mut dyn Any.

This is a trick to make the trait type castable into an Any.

fn type_id(&self) -> TypeId

Get the TypeId of this Extension.

Trait Implementations§

§

impl Extension for Box<dyn Extension>

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

Return the extension as &mut dyn Any. Read more
§

fn type_id(&self) -> TypeId

Get the TypeId of this Extension.

Implementations on Foreign Types§

§

impl Extension for Box<dyn Extension>

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for KeystoreExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for OffchainDbExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for OffchainWorkerExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for ProofSizeExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for ReadRuntimeVersionExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for TransactionPoolExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

§

impl Extension for UseDalekExt

§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

§

fn type_id(&self) -> TypeId

Implementors§