pub trait RequestExt<T>: BorrowMut<Request<T>> {
// Provided methods
fn try_pver(&self) -> Result<Option<u64>, Status> { ... }
fn pver(&self) -> Result<u64, Status> { ... }
fn set_pver(&mut self, pver: u64) { ... }
fn set_default_timeout(&mut self, timeout: Duration) { ... }
}Expand description
Extension trait on tonic::Request.
Provided Methods§
Sourcefn try_pver(&self) -> Result<Option<u64>, Status>
fn try_pver(&self) -> Result<Option<u64>, Status>
Check for the protocol version header.
Returns None in case of missing header.
Sourcefn pver(&self) -> Result<u64, Status>
fn pver(&self) -> Result<u64, Status>
Check for the protocol version header.
Returns error in case of missing header.
Sourcefn set_default_timeout(&mut self, timeout: Duration)
fn set_default_timeout(&mut self, timeout: Duration)
Sets a request timeout only if no timeout has already been set
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".