tarpc-cat 0.1.0

RPC framework built on comp-cat-rs: typed effects, no async, categorical foundations
Documentation
//! # tarpc-cat
//!
//! RPC framework built on [`comp-cat-rs`](https://crates.io/crates/comp-cat-rs).
//!
//! Wraps TCP networking with lazy, composable effects.  All operations
//! return [`Io<Error, A>`] and nothing executes until `.run()`.
//!
//! ## Quick start
//!
//! Define a service:
//!
//! ```rust,ignore
//! use tarpc_cat::serve::Serve;
//! use tarpc_cat::error::Error;
//! use comp_cat_rs::effect::io::Io;
//! use serde::{Serialize, Deserialize};
//!
//! #[derive(Serialize, Deserialize)]
//! struct Ping(String);
//!
//! #[derive(Serialize, Deserialize)]
//! struct Pong(String);
//!
//! #[derive(Clone)]
//! struct PingService;
//!
//! impl Serve for PingService {
//!     type Request = Ping;
//!     type Response = Pong;
//!
//!     fn handle(&self, request: Ping) -> Io<Error, Pong> {
//!         Io::pure(Pong(request.0))
//!     }
//! }
//! ```
//!
//! Run the server:
//!
//! ```rust,ignore
//! use tarpc_cat::server::{serve, ListenAddr};
//!
//! let addr = ListenAddr::new("127.0.0.1:9000".parse().unwrap());
//! serve(addr, PingService).run()?;
//! ```
//!
//! Call from a client:
//!
//! ```rust,ignore
//! use tarpc_cat::client::{call, ServerAddr};
//!
//! let addr = ServerAddr::new("127.0.0.1:9000".parse().unwrap());
//! let pong: Pong = call(addr, Ping("hello".into())).run()?;
//! ```
//!
//! [`Io<Error, A>`]: comp_cat_rs::effect::io::Io

pub mod client;
pub mod codec;
pub mod error;
pub mod protocol;
pub mod serve;
pub mod server;
pub mod transport;