Struct sp_externalities::Extensions [−][src]
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]
&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
Auto Trait Implementations
impl !RefUnwindSafe for Extensions
[src]
impl Send for Extensions
[src]
impl !Sync for Extensions
[src]
impl Unpin for Extensions
[src]
impl !UnwindSafe for Extensions
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,