timada_starter_client/
lib.rs

1#[cfg(feature = "feed")]
2mod feed;
3
4use http::uri::InvalidUri;
5use tonic::transport::Channel;
6
7#[cfg(feature = "proto")]
8tonic::include_proto!("starter");
9
10#[cfg(feature = "feed")]
11pub use feed::*;
12pub use tonic::Status;
13
14#[derive(Clone)]
15pub struct Client {
16    #[allow(dead_code)]
17    channel: Channel,
18}
19
20impl Client {
21    pub fn new<N: Into<String>>(url: N) -> Result<Self, InvalidUri> {
22        let channel = Channel::from_shared(url.into())?.connect_lazy();
23
24        Ok(Self { channel })
25    }
26}