Skip to content
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

Re-export tonic in cln-grpc #7545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 9, 2024

  1. Re-export tonic in cln-grpc

    Using `cln-grpc` in an outside crate is somewhat tricky.
    We currently do not have a way to describe the type of the
    `NodeClient<T>`
    
    The export allows the user to write the snippet below.
    
    ```rust
    struct App {
      grpc_client: NodeClient<cln_grpc::tonic::transport::Channel>
    }
    
    impl App {
    
      fn create(destination: AsRef<str>) -> Self {
        NodeClient::connect(destination.as_ref())
          .await
          .unwrap("Failed to connect")
      }
    }
    
    async fn main() {
      App::create("http://localhost:1234")
    }
    ```
    ErikDeSmedt committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    e221e72 View commit details
    Browse the repository at this point in the history