Struct prost_reflect::MethodDescriptor
source · pub struct MethodDescriptor { /* private fields */ }
Expand description
A method definition for a ServiceDescriptor
.
Implementations§
source§impl MethodDescriptor
impl MethodDescriptor
sourcepub fn new(service: ServiceDescriptor, index: usize) -> Self
pub fn new(service: ServiceDescriptor, index: usize) -> Self
Create a new MethodDescriptor
referencing the method at index
within the ServiceDescriptor
.
§Panics
Panics if index
is out-of-bounds.
sourcepub fn index(&self) -> usize
pub fn index(&self) -> usize
Gets the index of the method within the parent ServiceDescriptor
.
sourcepub fn parent_service(&self) -> &ServiceDescriptor
pub fn parent_service(&self) -> &ServiceDescriptor
Gets a reference to the ServiceDescriptor
this method is defined in.
sourcepub fn parent_pool(&self) -> &DescriptorPool
pub fn parent_pool(&self) -> &DescriptorPool
Gets a reference to the DescriptorPool
this method is defined in.
sourcepub fn parent_file(&self) -> FileDescriptor
pub fn parent_file(&self) -> FileDescriptor
Gets the FileDescriptor
this method is defined in.
sourcepub fn full_name(&self) -> &str
pub fn full_name(&self) -> &str
Gets the full name of the method, e.g. my.package.MyService.my_method
.
sourcepub fn path(&self) -> &[i32]
pub fn path(&self) -> &[i32]
Gets the path where this method is defined within the FileDescriptorProto
, e.g. [6, 0, 2, 0]
.
See path
for more details on the structure of the path.
sourcepub fn method_descriptor_proto(&self) -> &MethodDescriptorProto
pub fn method_descriptor_proto(&self) -> &MethodDescriptorProto
Gets a reference to the raw MethodDescriptorProto
wrapped by this MethodDescriptor
.
sourcepub fn options(&self) -> DynamicMessage
pub fn options(&self) -> DynamicMessage
Decodes the options defined for this MethodDescriptorProto
, including any extension options.
sourcepub fn input(&self) -> MessageDescriptor
pub fn input(&self) -> MessageDescriptor
Gets the MessageDescriptor
for the input type of this method.
sourcepub fn output(&self) -> MessageDescriptor
pub fn output(&self) -> MessageDescriptor
Gets the MessageDescriptor
for the output type of this method.
sourcepub fn is_client_streaming(&self) -> bool
pub fn is_client_streaming(&self) -> bool
Returns true
if the client streams multiple messages.
sourcepub fn is_server_streaming(&self) -> bool
pub fn is_server_streaming(&self) -> bool
Returns true
if the server streams multiple messages.
Trait Implementations§
source§impl Clone for MethodDescriptor
impl Clone for MethodDescriptor
source§fn clone(&self) -> MethodDescriptor
fn clone(&self) -> MethodDescriptor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MethodDescriptor
impl Debug for MethodDescriptor
source§impl PartialEq for MethodDescriptor
impl PartialEq for MethodDescriptor
source§fn eq(&self, other: &MethodDescriptor) -> bool
fn eq(&self, other: &MethodDescriptor) -> bool
self
and other
values to be equal, and is used
by ==
.