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.
Sourcepub fn iter_mut(
&mut self,
) -> impl Iterator<Item = (&TypeId, &mut Box<dyn Extension>)>
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&TypeId, &mut Box<dyn Extension>)>
Returns a mutable iterator over all extensions.
Sourcepub fn merge(&mut self, other: Self)
pub fn merge(&mut self, other: Self)
Merge other into self.
If both contain the same extension, the extension instance of other will overwrite the
instance found in self.
Sourcepub fn start_transaction(&mut self, ty: TransactionType)
pub fn start_transaction(&mut self, ty: TransactionType)
Start a transaction of type ty.
Sourcepub fn commit_transaction(&mut self, ty: TransactionType)
pub fn commit_transaction(&mut self, ty: TransactionType)
Commit a transaction of type ty.
Sourcepub fn rollback_transaction(&mut self, ty: TransactionType)
pub fn rollback_transaction(&mut self, ty: TransactionType)
Rollback a transaction of type ty.
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
§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.
§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