Struct prost_reflect::MethodDescriptor
source · [−]pub struct MethodDescriptor { /* private fields */ }Expand description
A method definition for a ServiceDescriptor.
Implementations
sourceimpl 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 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 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 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
sourceimpl Clone for MethodDescriptor
impl Clone for MethodDescriptor
sourcefn clone(&self) -> MethodDescriptor
fn clone(&self) -> MethodDescriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for MethodDescriptor
impl Debug for MethodDescriptor
sourceimpl PartialEq<MethodDescriptor> for MethodDescriptor
impl PartialEq<MethodDescriptor> for MethodDescriptor
sourcefn eq(&self, other: &MethodDescriptor) -> bool
fn eq(&self, other: &MethodDescriptor) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &MethodDescriptor) -> bool
fn ne(&self, other: &MethodDescriptor) -> bool
This method tests for !=.
impl Eq for MethodDescriptor
impl StructuralEq for MethodDescriptor
impl StructuralPartialEq for MethodDescriptor
Auto Trait Implementations
impl RefUnwindSafe for MethodDescriptor
impl Send for MethodDescriptor
impl Sync for MethodDescriptor
impl Unpin for MethodDescriptor
impl UnwindSafe for MethodDescriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more