Struct sp_externalities::Extensions
source · pub struct Extensions { /* private fields */ }
Expand description
Stores extensions that should be made available through the externalities.
Implementations§
source§impl Extensions
impl Extensions
sourcepub fn register_with_type_id(
&mut self,
type_id: TypeId,
extension: Box<dyn Extension>
) -> Result<(), Error>
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
.
sourcepub fn get_mut(&mut self, ext_type_id: TypeId) -> Option<&mut dyn Any>
pub fn get_mut(&mut self, ext_type_id: TypeId) -> Option<&mut dyn Any>
Return a mutable reference to the requested extension.
sourcepub fn deregister(&mut self, type_id: TypeId) -> bool
pub fn deregister(&mut self, type_id: TypeId) -> bool
Deregister extension for the given type_id
.
Returns true
when the extension was registered.
Trait Implementations§
source§impl Debug for Extensions
impl Debug for Extensions
source§impl Default for Extensions
impl Default for Extensions
source§fn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more
source§impl Extend<Extensions> for Extensions
impl Extend<Extensions> for Extensions
source§fn extend<T: IntoIterator<Item = Extensions>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Extensions>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more