Struct ic_kit::RawHandler
source · [−]pub struct RawHandler { /* private fields */ }Expand description
A method which uses Rust closures to handle the calls, it accepts every call.
Implementations
sourceimpl RawHandler
impl RawHandler
sourcepub fn raw(
handler: Box<dyn Fn(&mut MockContext, &Vec<u8>, &Principal, &str) -> CallResult<Vec<u8>>>
) -> Self
pub fn raw(
handler: Box<dyn Fn(&mut MockContext, &Vec<u8>, &Principal, &str) -> CallResult<Vec<u8>>>
) -> Self
Create a raw handler.
sourcepub fn new<T: for<'de> ArgumentDecoder<'de>, R: ArgumentEncoder, F: 'static + Fn(&mut MockContext, T, &Principal, &str) -> CallResult<R>>(
handler: F
) -> Self
pub fn new<T: for<'de> ArgumentDecoder<'de>, R: ArgumentEncoder, F: 'static + Fn(&mut MockContext, T, &Principal, &str) -> CallResult<R>>(
handler: F
) -> Self
Create a new handler.
Trait Implementations
sourceimpl CallHandler for RawHandler
impl CallHandler for RawHandler
Auto Trait Implementations
impl !RefUnwindSafe for RawHandler
impl !Send for RawHandler
impl !Sync for RawHandler
impl Unpin for RawHandler
impl !UnwindSafe for RawHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more