seunlanlege/arc-reactor
소개
A web framework for rust.
웹 및 앱 개발What you can do
- Asynchronous. In arc reactor, Service Handlers are asynchronous by default.
- Integration With futures-await. The #[service] proc_macro not only derives the ArcService trait for your route handler, but also marks it as #[async] so you can await on futures in your route handlers with no extra stress.
- Intuitive Middleware System. arc reactor exposes a middleware system that is easy to reason about. Have a look at the design spec
- Minimalistic. arc reactor is designed to be a very thin abstraction over tokio and hyper.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalArc-reactor
An Asynchronous, Extensible, Micro web framework for Rust.
Features
Asynchronous. In arc reactor, Service Handlers are asynchronous by default.
Integration With futures-await. The
#[service]proc_macro not only derives theArcServicetrait for your route handler, but also marks it as#[async]so you can await on futures in your route handlers with no extra stress.Intuitive Middleware System. arc reactor exposes a middleware system that is easy to reason about. Have a look at the design spec
Minimalistic. arc reactor is designed to be a very thin abstraction over tokio and hyper.
TLS Support. easy to add tls support.
Opt-in to Nightly. arc reactor uses a lot of cool features, including
proc_macroswhich are only available on the nightly channel, using theunstablefeature flag.
Installation
Add this to your cargo.toml
arc-reactor = "0.2"
Hello World (default)

Demo (unstable)

Nightly Use
Originally, arc-reactor was designed for the nightly compiler.
But instabilities in libprocmacro cause it to break everytime a new nightly compiler is released.
So by default, arc-reactor no longer uses the nightly compiler, and will work out of the box with the stable compiler. 🎉
This means experimental nightly features including proc_macros are only available behind the unstable feature flag.
If you wish to use arc-reactor, with the nightly compiler and unstable feature enabled:
It is recommended that you lock down the compiler version. Until libprocmacro is stablized.
If you wish to use arc-reactor with it's default features:
- The trait
ArcServiceis implemented for all functions that satisfy the signatureFn(Request, Response) -> FutureResponse - The trait
MiddleWare<Request>is implemented for all functions that satisfy the signatureFn(Request) -> MiddleWareFuture<Request> - The trait
MiddleWare<Response>is implemented for all functions that satisfy the signatureFn(Response) -> MiddleWareFuture<Response> futuresfromfutures-rsis re-exported instead offutures-await.- you lose the ability to
await!on futures in your ServiceHandlers and MiddleWares. - Currently, Multipart support is implemented using unstable features, so you would have to implement your own.
Examples
Check out the examples folder and the api documentation to get a feel for how arc reactor works.
It's well documented and should get you up and running in no time.
Design
It is Strongly recommended that you read the design document, as it gives you full disclosure on arc-reactor's internals, as well as the design decisions that were made.
Contributions
Arc-Reactor is highly extensible via middlewares which are placed in the contrib module.
Some of the things are missing include:
- Logger
- Websocket
- Support byte range headers
- Asynchronous StaticFileServer
- Json body parser
- Multipart Support
Feel free to submit a PR.
License
Refer to License.
관련 프로젝트 살펴보기
불러오는 중…