{"id":57208,"library":"tower-service","title":"Tower Service","description":"Trait representing an asynchronous, request/response based, client or server.","status":"active","version":"0.3.3","language":"rust","source_language":null,"source_url":"https://github.com/tower-rs/tower","tags":["async","service","tower","middleware"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\ntower-service = \"0.3.3\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add tower-service","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Service","correct":"use tower_service::Service;"}],"quickstart":{"code":"use tower_service::Service;\nuse std::task::{Context, Poll};\n\nstruct MyService;\n\nimpl Service<String> for MyService {\n    type Response = String;\n    type Error = std::io::Error;\n    type Future = std::future::Ready<Result<Self::Response, Self::Error>>;\n\n    fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {\n        Poll::Ready(Ok(()))\n    }\n\n    fn call(&mut self, req: String) -> Self::Future {\n        std::future::ready(Ok(format!(\"Echo: {}\", req)))\n    }\n}\n\nfn main() {\n    let mut svc = MyService;\n    let fut = svc.call(\"hello\".to_string());\n    println!(\"{:?}\", fut.into_inner());\n}","lang":"rust","description":"Implement the Service trait for a simple echo service."},"warnings":[],"env_vars":null,"search_vec":"'async':12 'asynchron':6 'base':8 'client':9 'middlewar':15 'repres':4 'request/response':7 'server':11 'servic':2,13 'tower':1,14 'trait':3","created_at":"2026-06-16T15:32:56.047789+00:00","updated_at":"2026-06-16T15:32:56.047789+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/tower-rs/tower","github":"https://github.com/tower-rs/tower","docs":"https://docs.rs/tower-service/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["async","networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}