pub(crate) struct ErasedCallback<I, C>{
pub(crate) inner: C,
pub(crate) _marker: PhantomData<fn() -> I>,
}Expand description
Adapter so any typed HookCallback<I> implements
ErasedHookCallback when I: DeserializeOwned.
Fields§
§inner: C§_marker: PhantomData<fn() -> I>Trait Implementations§
Source§impl<I, C> ErasedHookCallback for ErasedCallback<I, C>
impl<I, C> ErasedHookCallback for ErasedCallback<I, C>
Source§fn call_erased<'life0, 'async_trait>(
&'life0 self,
input: Value,
context: HookContext,
) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call_erased<'life0, 'async_trait>(
&'life0 self,
input: Value,
context: HookContext,
) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deserialise
input into the concrete input type and invoke the
wrapped callback.Auto Trait Implementations§
impl<I, C> Freeze for ErasedCallback<I, C>
impl<I, C> RefUnwindSafe for ErasedCallback<I, C>
impl<I, C> Send for ErasedCallback<I, C>
impl<I, C> Sync for ErasedCallback<I, C>
impl<I, C> Unpin for ErasedCallback<I, C>
impl<I, C> UnsafeUnpin for ErasedCallback<I, C>
impl<I, C> UnwindSafe for ErasedCallback<I, C>
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