All Projects → actix → actix-derive

actix / actix-derive

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
[ARCHIVED] development moved into main actix repo

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to actix-derive

vfin
🦈 GUI framework agnostic virtual DOM library
Stars: ✭ 17 (-55.26%)
Mutual labels:  rust-library
shell2batch
Coverts simple basic shell scripts to windows batch scripts.
Stars: ✭ 42 (+10.53%)
Mutual labels:  rust-library
rust-lcms2
ICC color profiles in Rust
Stars: ✭ 25 (-34.21%)
Mutual labels:  rust-library
twitter-stream-rs
A Rust library for listening on Twitter Streaming API.
Stars: ✭ 66 (+73.68%)
Mutual labels:  rust-library
ghakuf
A Rust library for parsing/building SMF (Standard MIDI File).
Stars: ✭ 30 (-21.05%)
Mutual labels:  rust-library
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-34.21%)
Mutual labels:  rust-library
crc32c
Fast CRC-32-Castagnoli implementation in Rust
Stars: ✭ 26 (-31.58%)
Mutual labels:  rust-library
finny.rs
Finite State Machines for Rust
Stars: ✭ 48 (+26.32%)
Mutual labels:  rust-library
codebreaker-rs
A Rust library to decrypt & encrypt any cheat code for CodeBreaker PS2
Stars: ✭ 18 (-52.63%)
Mutual labels:  rust-library
rust cms
使用Rust编写一个CMS(内容管理系统)可以做为个人博客,公司网站
Stars: ✭ 32 (-15.79%)
Mutual labels:  actix
tentacle
A multiplexed p2p network framework that supports custom protocols
Stars: ✭ 41 (+7.89%)
Mutual labels:  rust-library
colorful
Make your terminal output colorful.
Stars: ✭ 43 (+13.16%)
Mutual labels:  rust-library
rsmorphy
Morphological analyzer / inflection engine for Russian and Ukrainian languages rewritten in Rust
Stars: ✭ 27 (-28.95%)
Mutual labels:  rust-library
contour-rs
Contour polygon creation in Rust (using marching squares algorithm)
Stars: ✭ 33 (-13.16%)
Mutual labels:  rust-library
imgref
A trivial Rust struct for interchange of pixel buffers with width, height & stride
Stars: ✭ 45 (+18.42%)
Mutual labels:  rust-library
Nebuchadnezzar
High Performance Key-Value Store
Stars: ✭ 49 (+28.95%)
Mutual labels:  rust-library
rustgraphblas
rust-library to wrap GraphBLAS.h
Stars: ✭ 23 (-39.47%)
Mutual labels:  rust-library
prettysize-rs
Pretty-print file sizes and more
Stars: ✭ 29 (-23.68%)
Mutual labels:  rust-library
httper
An asynchronous HTTP(S) client built on top of hyper.
Stars: ✭ 16 (-57.89%)
Mutual labels:  rust-library
type-metadata
Rust type metadata reflection library
Stars: ✭ 27 (-28.95%)
Mutual labels:  rust-library

actix-derive Build Status crates.io

Actix is a rust actor framework.


Features

  • actix-derive adds support for Rust Custom Derive / Macros 1.1 to actix

Usage

use actix_derive::{Message, MessageResponse};

#[derive(MessageResponse)]
struct Added(usize);

#[derive(Message)]
#[rtype(result = "Added")]
struct Sum(usize, usize);

fn main() {}

This code expands into following code:

use actix::{Actor, Context, Handler, System};
use actix_derive::{Message, MessageResponse};

#[derive(MessageResponse)]
struct Added(usize);

#[derive(Message)]
#[rtype(result = "Added")]
struct Sum(usize, usize);

#[derive(Default)]
struct Adder;

impl Actor for Adder {
    type Context = Context<Self>;
}

impl Handler<Sum> for Adder {
    type Result = <Sum as actix::Message>::Result;
    fn handle(&mut self, msg: Sum, _: &mut Self::Context) -> Added {
        Added(msg.0 + msg.1)
    }
}

fn main() {}

License

This project is licensed under either of

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].