pub fn user_agent<T>(self, user_agent: T) -> Result<Self, Error>
    where
        T: TryInto<HeaderValue>,
    {
        user_agent
            .try_into()
            .map(|ua| Endpoint {
                user_agent: Some(ua),
                ..self
            })
            .map_err(|_| Error::new_invalid_user_agent())
    }
Set a custom user-agent header.

`user_agent` will be prepended to Tonic's default user-agent string (`tonic/x.x.x`).
It must be a value that can be converted into a valid  `http::HeaderValue` or building
the endpoint will fail.
```
# use tonic::transport::Endpoint;
# let mut builder = Endpoint::from_static("https://example.com");
builder.user_agent("Greeter").expect("Greeter should be a valid header value");
// user-agent: "Greeter tonic/x.x.x"
```
tonic/src/transport/channel/endpoint.rs