Registry / async / tokio-service

tokio-service

JSON →
library0.1.0rscratesunverified

Defines the core `Service` trait for asynchronous request/response processing in Tokio.

# Cargo.toml [dependencies] tokio-service = "0.1.0"
INSTALL
IMPORT
SIG · TOKIO-SERVICE
T
tokio-service
asyncrustv0.1.0
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.

Service
use tokio_service::Service;

Implement the Service trait for a simple echo service.

use tokio_service::Service; struct MyService; impl Service for MyService { type Request = String; type Response = String; type Error = std::io::Error; type Future = futures::future::Ready<Result<Self::Response, Self::Error>>; fn call(&self, req: Self::Request) -> Self::Future { futures::future::ok(req) } }
Debug
Known issues
breakingThis crate is very old and may not be compatible with modern Tokio versions.
fix
Use tower::Service from the tower crate instead.
affects: >=0.1.0
Upgrade
Version history
0.1.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
28
Resources