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 actix_service::Service;
Define a simple service implementing the Service trait.
use actix_service::Service;
use futures_util::future::ok;
struct MyService;
impl Service for MyService {
type Request = String;
type Response = String;
type Error = ();
type Future = futures_util::future::Ready<Result<String, ()>>;
fn poll_ready(&self, _: &mut std::task::Context<'_>) -> std::task::Poll<Result<(), Self::Error>> {
std::task::Poll::Ready(Ok(()))
}
fn call(&self, req: String) -> Self::Future {
ok(req)
}
}
fn main() {
let svc = MyService;
let res = svc.call("hello".into()).into_inner();
println!("{:?}", res);
}
Audit
Dependencies
No dependency data recorded yet.