Registry / async / actix
library0.13.5rscratesunverified

Actor framework for Rust

# Cargo.toml [dependencies] actix = "0.13.5"
INSTALL
IMPORT
SIG · ACTIX
A
actix
asyncrustv0.13.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Actor
use actix::Actor;

Define an actor that handles messages and run it with the actix system.

use actix::{Actor, Context, Handler, Message}; struct MyActor; impl Actor for MyActor { type Context = Context<Self>; } struct Ping; impl Message for Ping { type Result = String; } impl Handler<Ping> for MyActor { type Result = String; fn handle(&mut self, _msg: Ping, _ctx: &mut Context<Self>) -> String { "Pong".to_string() } } fn main() { let sys = actix::System::new(); sys.block_on(async { let addr = MyActor.start(); let res = addr.send(Ping).await.unwrap(); println!("{}", res); }); }
Debug
Known issues
gotchaRequires an async runtime (actix-rt) to run actors.
fix
Add actix-rt as a dependency and use #[actix_rt::main] or System::new().
affects: >=0.10
Upgrade
Version history
0.13.5latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
59 hits · last 30 days
node
48
OpenAI (training)
1
Resources
actix — cargo add actix · libregistry