Struct sp_runtime_interface::wasm::ExchangeableFunction
source · pub struct ExchangeableFunction<T>(/* private fields */);
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
.
Trait Implementations§
impl<T> Sync for ExchangeableFunction<T>
Auto Trait Implementations§
impl<T> !Freeze for ExchangeableFunction<T>
impl<T> !RefUnwindSafe for ExchangeableFunction<T>
impl<T> Send for ExchangeableFunction<T>where
T: Send,
impl<T> Unpin for ExchangeableFunction<T>where
T: Unpin,
impl<T> UnwindSafe for ExchangeableFunction<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more