Skip to content

Allow custom headers and extensions for twirp clients and servers; unify traits; unify error type #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Leave some notes
  • Loading branch information
tclem committed Jul 11, 2025
commit f4250971ee825277e203ce1cd8c77cb5412e0743
11 changes: 11 additions & 0 deletions example/src/bin/advanced-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ async fn ping() -> &'static str {
"Pong\n"
}

/// You can run this end-to-end example by running both a server and a client and observing the requests/responses.
///
/// 1. Run the server:
/// ```sh
/// cargo run --bin advanced-server
/// ```
///
/// 2. In another shell, run the client:
/// ```sh
/// cargo run --bin client
/// ```
#[tokio::main]
pub async fn main() {
let api_impl = HaberdasherApiServer {};
Expand Down
11 changes: 11 additions & 0 deletions example/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ use service::haberdash::v1::{
GetStatusRequest, GetStatusResponse, HaberdasherApi, MakeHatRequest, MakeHatResponse,
};

/// You can run this end-to-end example by running both a server and a client and observing the requests/responses.
///
/// 1. Run the server:
/// ```sh
/// cargo run --bin advanced-server # OR cargo run --bin simple-server
/// ```
///
/// 2. In another shell, run the client:
/// ```sh
/// cargo run --bin client
/// ```
#[tokio::main]
pub async fn main() -> Result<(), GenericError> {
// basic client
Expand Down
11 changes: 11 additions & 0 deletions example/src/bin/simple-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ async fn ping() -> &'static str {
"Pong\n"
}

/// You can run this end-to-end example by running both a server and a client and observing the requests/responses.
///
/// 1. Run the server:
/// ```sh
/// cargo run --bin simple-server
/// ```
///
/// 2. In another shell, run the client:
/// ```sh
/// cargo run --bin client
/// ```
#[tokio::main]
pub async fn main() {
let api_impl = HaberdasherApiServer {};
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy