fn handle(&mut self, msg: Invocation, ctx: &mut Self::Context) -> Self::Result {
        let state = self.state.as_ref().unwrap();

        trace!(
            "Actor Invocation - From {} to {}: {}",
            msg.origin.url(),
            msg.target.url(),
            msg.operation
        );

        if let WasccEntity::Actor(ref target) = msg.target {
            if run_actor_pre_invoke(&msg, &state.mw_chain).is_err() {
                return InvocationResponse::error(
                    &msg,
                    "Pre-invoke middleware execution failure on actor",
                );
            }
            match state.guest_module.call(&msg.operation, &msg.msg) {
                Ok(v) => {
                    let resp = InvocationResponse::success(&msg, v);
                    match run_actor_post_invoke(resp, &state.mw_chain) {
                        Ok(r) => r,
                        Err(e) => InvocationResponse::error(
                            &msg,
                            &format!("Post-invoke middleware execution failure on actor: {}", e),
                        ),
                    }
                }
                Err(e) => {
                    InvocationResponse::error(&msg, &format!("Failed to invoke actor: {}", e))
                }
            }
        } else {
            InvocationResponse::error(
                &msg,
                "Actor received invocation that should have been delivered to a provider",
            )
        }
    }
/// Receives an invocation from any source. This will execute the full pre-exec
/// middleware chain, perform the requested operation, and then perform the full
/// post-exec middleware chain, assuming no errors indicate a pre-emptive halt
Receives an invocation from any source. This will execute the full pre-exec
middleware chain, perform the requested operation, and then perform the full
post-exec middleware chain, assuming no errors indicate a pre-emptive halt
Receives an invocation from any source . This will execute the full pre - exec middleware chain perform the requested operation and then perform the full post - exec middleware chain assuming no errors indicate a pre - emptive halt
fn handle(&mut self, msg: Invocation, ctx: &mut Self::Context) -> Self::Result {
        let state = self.state.as_ref().unwrap();
        trace!(
            "Actor Invocation - From {} to {}: {}",
            msg.origin.url(),
            msg.target.url(),
            msg.operation
        );
        if let WasccEntity::Actor(ref target) = msg.target {
            if run_actor_pre_invoke(&msg, &state.mw_chain).is_err() {
                return InvocationResponse::error(
                    &msg,
                    "Pre-invoke middleware execution failure on actor",
                );
            }
            match state.guest_module.call(&msg.operation, &msg.msg) {
                Ok(v) => {
                    let resp = InvocationResponse::success(&msg, v);
                    match run_actor_post_invoke(resp, &state.mw_chain) {
                        Ok(r) => r,
                        Err(e) => InvocationResponse::error(
                            &msg,
                            &format!("Post-invoke middleware execution failure on actor: {}", e),
                        ),
                    }
                }
                Err(e) => {
                    InvocationResponse::error(&msg, &format!("Failed to invoke actor: {}", e))
                }
            }
        } else {
            InvocationResponse::error(
                &msg,
                "Actor received invocation that should have been delivered to a provider",
            )
        }
    }
fn handle ( & mut self , msg : Invocation , ctx : & mut Self :: Context ) -> Self :: Result { let state = self . state . as_ref ( ) . unwrap ( ) ; trace ! ( " " msg origin url ( ) msg target url ( ) msg operation ) ; if let WasccEntity :: Actor ( ref target ) = msg . target { if run_actor_pre_invoke ( & msg , & state . mw_chain ) . is_err ( ) { return InvocationResponse :: error ( & msg , " " , ) ; } match state . guest_module . call ( & msg . operation , & msg . msg ) { Ok ( v ) => { let resp = InvocationResponse :: success ( & msg , v ) ; match run_actor_post_invoke ( resp , & state . mw_chain ) { Ok ( r ) => r , Err ( e ) => InvocationResponse :: error ( & msg , & format ! ( " " e ) , ) , } } Err ( e ) => { InvocationResponse :: error ( & msg , & format ! ( " " e ) ) } } } else { InvocationResponse :: error ( & msg , " " , ) } }
Receives an invocation from any source.
Receives an invocation from any source .
&mut self
msg
Invocation
ctx
&mut Self::Context
&mut self
msg
Invocation
ctx
&mut Self::Context