Struct sp_externalities::Extensions
source · [−]pub struct Extensions { /* private fields */ }
Expand description
Stores extensions that should be made available through the externalities.
Implementations
sourceimpl 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
sourceimpl Debug for Extensions
impl Debug for Extensions
sourceimpl Default for Extensions
impl Default for Extensions
sourcefn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more