#[non_exhaustive]pub struct MethodDescriptorProto {
pub name: String,
pub input_type: String,
pub output_type: String,
pub options: Option<MethodOptions>,
pub client_streaming: bool,
pub server_streaming: bool,
/* private fields */
}Expand description
Describes a method of a service.
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.name: String§input_type: StringInput and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.
output_type: String§options: Option<MethodOptions>§client_streaming: boolIdentifies if client streams multiple client messages
server_streaming: boolIdentifies if server streams multiple server messages
Implementations§
Source§impl MethodDescriptorProto
impl MethodDescriptorProto
pub fn new() -> Self
Sourcepub fn set_input_type<T: Into<String>>(self, v: T) -> Self
pub fn set_input_type<T: Into<String>>(self, v: T) -> Self
Sets the value of input_type.
§Example
ⓘ
let x = MethodDescriptorProto::new().set_input_type("example");Sourcepub fn set_output_type<T: Into<String>>(self, v: T) -> Self
pub fn set_output_type<T: Into<String>>(self, v: T) -> Self
Sets the value of output_type.
§Example
ⓘ
let x = MethodDescriptorProto::new().set_output_type("example");Sourcepub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<MethodOptions>,
pub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<MethodOptions>,
Sourcepub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<MethodOptions>,
pub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<MethodOptions>,
Sourcepub fn set_client_streaming<T: Into<bool>>(self, v: T) -> Self
pub fn set_client_streaming<T: Into<bool>>(self, v: T) -> Self
Sets the value of client_streaming.
§Example
ⓘ
let x = MethodDescriptorProto::new().set_client_streaming(true);Sourcepub fn set_server_streaming<T: Into<bool>>(self, v: T) -> Self
pub fn set_server_streaming<T: Into<bool>>(self, v: T) -> Self
Sets the value of server_streaming.
§Example
ⓘ
let x = MethodDescriptorProto::new().set_server_streaming(true);Trait Implementations§
Source§impl Clone for MethodDescriptorProto
impl Clone for MethodDescriptorProto
Source§fn clone(&self) -> MethodDescriptorProto
fn clone(&self) -> MethodDescriptorProto
Returns a duplicate of the value. Read more
1.0.0 · 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 MethodDescriptorProto
impl Debug for MethodDescriptorProto
Source§impl Default for MethodDescriptorProto
impl Default for MethodDescriptorProto
Source§fn default() -> MethodDescriptorProto
fn default() -> MethodDescriptorProto
Returns the “default value” for a type. Read more
Source§impl Message for MethodDescriptorProto
impl Message for MethodDescriptorProto
Source§impl PartialEq for MethodDescriptorProto
impl PartialEq for MethodDescriptorProto
impl StructuralPartialEq for MethodDescriptorProto
Auto Trait Implementations§
impl Freeze for MethodDescriptorProto
impl RefUnwindSafe for MethodDescriptorProto
impl Send for MethodDescriptorProto
impl Sync for MethodDescriptorProto
impl Unpin for MethodDescriptorProto
impl UnwindSafe for MethodDescriptorProto
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