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
sourceimpl<T> ExchangeableFunction<T>
impl<T> ExchangeableFunction<T>
sourceimpl<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> !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
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more