Struct sp_externalities::Extensions[][src]

pub struct Extensions { /* fields omitted */ }

Stores extensions that should be made available through the externalities.


impl Extensions[src]

pub fn new() -> Self[src]

Create new instance of Self.

pub fn register<E: Extension>(&mut self, ext: E)[src]

Register the given extension.

pub fn register_with_type_id(
    &mut self,
    type_id: TypeId,
    extension: Box<dyn Extension>
) -> Result<(), Error>

Register extension extension using the given type_id.

pub fn get_mut(&mut self, ext_type_id: TypeId) -> Option<&mut dyn Any>[src]

Return a mutable reference to the requested extension.

pub fn deregister(&mut self, type_id: TypeId) -> bool[src]

Deregister extension for the given type_id.

Returns true when the extension was registered.

pub fn iter_mut<'a>(
    &'a mut self
) -> impl Iterator<Item = (&'a TypeId, &'a mut Box<dyn Extension>)>

Returns a mutable iterator over all extensions.

Trait Implementations

impl Debug for Extensions[src]

impl Default for Extensions[src]

Auto Trait Implementations

impl !RefUnwindSafe for Extensions

impl Send for Extensions

impl !Sync for Extensions

impl Unpin for Extensions

impl !UnwindSafe for Extensions

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.