Skip to main content

BatchingDescriptorProto

Struct BatchingDescriptorProto 

Source
#[non_exhaustive]
pub struct BatchingDescriptorProto { pub batched_field: String, pub discriminator_fields: Vec<String>, pub subresponse_field: String, /* private fields */ }
Expand description

BatchingDescriptorProto specifies the fields of the request message to be used for batching, and, optionally, the fields of the response message to be used for demultiplexing.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§batched_field: String

The repeated field in the request message to be aggregated by batching.

§discriminator_fields: Vec<String>

A list of the fields in the request message. Two requests will be batched together only if the values of every field specified in request_discriminator_fields is equal between the two requests.

§subresponse_field: String

Optional. When present, indicates the field in the response message to be used to demultiplex the response into multiple response messages, in correspondence with the multiple request messages originally batched together.

Implementations§

Source§

impl BatchingDescriptorProto

Source

pub fn new() -> Self

Source

pub fn set_batched_field<T: Into<String>>(self, v: T) -> Self

Sets the value of batched_field.

§Example
let x = BatchingDescriptorProto::new().set_batched_field("example");
Source

pub fn set_discriminator_fields<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of discriminator_fields.

§Example
let x = BatchingDescriptorProto::new().set_discriminator_fields(["a", "b", "c"]);
Source

pub fn set_subresponse_field<T: Into<String>>(self, v: T) -> Self

Sets the value of subresponse_field.

§Example
let x = BatchingDescriptorProto::new().set_subresponse_field("example");

Trait Implementations§

Source§

impl Clone for BatchingDescriptorProto

Source§

fn clone(&self) -> BatchingDescriptorProto

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BatchingDescriptorProto

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BatchingDescriptorProto

Source§

fn default() -> BatchingDescriptorProto

Returns the “default value” for a type. Read more
Source§

impl Message for BatchingDescriptorProto

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for BatchingDescriptorProto

Source§

fn eq(&self, other: &BatchingDescriptorProto) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BatchingDescriptorProto

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,