Struct sp_runtime_interface::wasm::ExchangeableFunction
source · pub struct ExchangeableFunction<T>(_);
Expand description
A function which implementation can be exchanged.
Internally this works by swapping function pointers.
Implementations§
source§impl<T> ExchangeableFunction<T>
impl<T> ExchangeableFunction<T>
source§impl<T: Copy> ExchangeableFunction<T>
impl<T: Copy> ExchangeableFunction<T>
sourcepub fn replace_implementation(
&'static self,
new_impl: T
) -> RestoreImplementation<T>
pub fn replace_implementation( &'static self, new_impl: T ) -> RestoreImplementation<T>
Replace the implementation with new_impl
.
Panics
Panics when trying to replace an already replaced implementation.
Returns
Returns the original implementation wrapped in RestoreImplementation
.