Fix Skeptic trying to run trait implementation snippet
@@ -165,9 +165,9 @@ fn main() {
## Responding with a MessageResponse
-Let's take a look at the `Result` type defined for the `impl Handler` in the above example. See how we're returning a `Result<bool, io::Error>`? We're able to respond to our actor's incoming message with this type because it has the `MessageResponse` trait implemented for that type. Here's the definition:
+Let's take a look at the `Result` type defined for the `impl Handler` in the above example. See how we're returning a `Result<bool, io::Error>`? We're able to respond to our actor's incoming message with this type because it has the `MessageResponse` trait implemented for that type. Here's the definition for that trait:
-```rust
+```
pub trait MessageResponse<A: Actor, M: Message> {
fn handle<R: ResponseChannel<M>>(self, ctx: &mut A::Context, tx: Option<R>);
}
@@ -258,7 +258,7 @@ fn main() {
Responses::GotPing => println!("Ping received"),
Responses::GotPong => println!("Pong received"),
}
- Arbiter::system().do_send(actix::msgs::SystemExit(0));
+# Arbiter::system().do_send(actix::msgs::SystemExit(0));
})
.map_err(|e| {
println!("Actor is probably died: {}", e);
@@ -273,7 +273,7 @@ fn main() {
Responses::GotPing => println!("Ping received"),
Responses::GotPong => println!("Pong received"),
}
- Arbiter::system().do_send(actix::msgs::SystemExit(0));
+# Arbiter::system().do_send(actix::msgs::SystemExit(0));
})
.map_err(|e| {
println!("Actor is probably died: {}", e);
