pub struct RawHandler { /* private fields */ }Expand description
A method which uses Rust closures to handle the calls, it accepts every call.
Implementations§
Source§impl 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§
Source§impl CallHandler for RawHandler
impl CallHandler for RawHandler
Auto Trait Implementations§
impl Freeze for RawHandler
impl !RefUnwindSafe for RawHandler
impl !Send for RawHandler
impl !Sync for RawHandler
impl Unpin for RawHandler
impl !UnwindSafe for RawHandler
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