pub fn set_timeout(&mut self, deadline: Duration) {
        let value: MetadataValue<_> = duration_to_grpc_timeout(deadline).parse().unwrap();
        self.metadata_mut()
            .insert(crate::metadata::GRPC_TIMEOUT_HEADER, value);
    }
Set the max duration the request is allowed to take.

Requires the server to support the `grpc-timeout` metadata, which Tonic does.

The duration will be formatted according to [the spec] and use the most precise unit
possible.

Example:

```rust
use std::time::Duration;
use tonic::Request;

let mut request = Request::new(());

request.set_timeout(Duration::from_secs(30));

let value = request.metadata().get("grpc-timeout").unwrap();

assert_eq!(
value,
// equivalent to 30 seconds
"30000000u"
);
```

[the spec]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
tonic/src/request.rs