pub struct CallOptions {
pub metadata: Metadata,
pub timeout: Option<Duration>,
pub max_message_bytes: Option<usize>,
}Expand description
Per-call options.
Fields§
§metadata: Metadata§timeout: Option<Duration>Deadline for the call.
Sent as grpc-timeout and enforced locally, because the header alone
guarantees nothing: it is a request to the far end, and a peer that ignores
it leaves the caller waiting forever. The header still goes out so anything
that does enforce it — a server, a proxy, an upstream — can.
On a stream this covers the whole call, not just its opening: one timer spans the request and every message read after it. Bounding only the open would miss the case the deadline exists for, a peer that answers promptly and then stalls.
max_message_bytes: Option<usize>Reject an inbound message larger than this (RESOURCE_EXHAUSTED).
Implementations§
Source§impl CallOptions
impl CallOptions
pub fn new() -> CallOptions
pub fn with_metadata(self, metadata: Metadata) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_max_message_bytes(self, max: usize) -> Self
Trait Implementations§
Source§impl Clone for CallOptions
impl Clone for CallOptions
Source§fn clone(&self) -> CallOptions
fn clone(&self) -> CallOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CallOptions
impl Debug for CallOptions
Source§impl Default for CallOptions
impl Default for CallOptions
Source§fn default() -> CallOptions
fn default() -> CallOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CallOptions
impl RefUnwindSafe for CallOptions
impl Send for CallOptions
impl Sync for CallOptions
impl Unpin for CallOptions
impl UnsafeUnpin for CallOptions
impl UnwindSafe for CallOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more