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 more