#[non_exhaustive]pub struct RequestOptions {
pub priority: Priority,
pub request_tag: String,
pub transaction_tag: String,
pub client_context: Option<ClientContext>,
/* private fields */
}Expand description
Common request options for various APIs.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.priority: PriorityPriority for the request.
request_tag: StringA per-request tag which can be applied to queries or reads, used for
statistics collection.
Both request_tag and transaction_tag can be specified for a read or
query that belongs to a transaction.
This field is ignored for requests where it’s not applicable (for example,
CommitRequest).
Legal characters for request_tag values are all printable characters
(ASCII 32 - 126) and the length of a request_tag is limited to 50
characters. Values that exceed this limit are truncated.
Any leading underscore (_) characters are removed from the string.
transaction_tag: StringA tag used for statistics collection about this transaction.
Both request_tag and transaction_tag can be specified for a read or
query that belongs to a transaction.
To enable tagging on a transaction, transaction_tag must be set to the
same value for all requests belonging to the same transaction, including
BeginTransaction.
If this request doesn’t belong to any transaction, transaction_tag is
ignored.
Legal characters for transaction_tag values are all printable characters
(ASCII 32 - 126) and the length of a transaction_tag is limited to 50
characters. Values that exceed this limit are truncated.
Any leading underscore (_) characters are removed from the string.
client_context: Option<ClientContext>Optional. Optional context that may be needed for some requests.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn set_priority<T: Into<Priority>>(self, v: T) -> Self
pub fn set_priority<T: Into<Priority>>(self, v: T) -> Self
Sets the value of priority.
Sourcepub fn set_request_tag<T: Into<String>>(self, v: T) -> Self
pub fn set_request_tag<T: Into<String>>(self, v: T) -> Self
Sets the value of request_tag.
Sourcepub fn set_transaction_tag<T: Into<String>>(self, v: T) -> Self
pub fn set_transaction_tag<T: Into<String>>(self, v: T) -> Self
Sets the value of transaction_tag.
Sourcepub fn set_client_context<T>(self, v: T) -> Selfwhere
T: Into<ClientContext>,
pub fn set_client_context<T>(self, v: T) -> Selfwhere
T: Into<ClientContext>,
Sets the value of client_context.
Sourcepub fn set_or_clear_client_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<ClientContext>,
pub fn set_or_clear_client_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<ClientContext>,
Sets or clears the value of client_context.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestOptions
impl Debug for RequestOptions
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Source§impl Message for RequestOptions
impl Message for RequestOptions
Source§impl PartialEq for RequestOptions
impl PartialEq for RequestOptions
Source§fn eq(&self, other: &RequestOptions) -> bool
fn eq(&self, other: &RequestOptions) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RequestOptions
Auto Trait Implementations§
impl Freeze for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptions
impl UnwindSafe for RequestOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request