Struct sp_externalities::Extensions [−][src]
pub struct Extensions { /* fields omitted */ }Stores extensions that should be made available through the externalities.
Implementations
impl Extensions[src]
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]
&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>)>[src]
&'a mut self
) -> impl Iterator<Item = (&'a TypeId, &'a mut Box<dyn Extension>)>
Returns a mutable iterator over all extensions.
Trait Implementations
impl Default for Extensions[src]
impl Default for Extensions[src]