[][src]Struct sp_externalities::Extensions

pub struct Extensions { /* fields omitted */ }

Stores extensions that should be made available through the externalities.

Implementations

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>
[src]

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>)>
[src]

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.