Struct prost_reflect::ServiceDescriptor
source · [−]pub struct ServiceDescriptor { /* private fields */ }Expand description
A protobuf service definition.
Implementations
sourceimpl ServiceDescriptor
impl ServiceDescriptor
sourcepub fn new(descriptor_pool: DescriptorPool, index: usize) -> Self
pub fn new(descriptor_pool: DescriptorPool, index: usize) -> Self
Create a new ServiceDescriptor referencing the service at index within the given DescriptorPool.
Panics
Panics if index is out-of-bounds.
sourcepub fn index(&self) -> usize
pub fn index(&self) -> usize
Returns the index of this ServiceDescriptor within the parent DescriptorPool.
sourcepub fn parent_pool(&self) -> &DescriptorPool
pub fn parent_pool(&self) -> &DescriptorPool
Gets a reference to the DescriptorPool this service is defined in.
sourcepub fn package_name(&self) -> &str
pub fn package_name(&self) -> &str
Gets the name of the package this service is defined in, e.g. my.package.
If no package name is set, an empty string is returned.
sourcepub fn service_descriptor_proto(&self) -> &ServiceDescriptorProto
pub fn service_descriptor_proto(&self) -> &ServiceDescriptorProto
Gets a reference to the raw ServiceDescriptorProto wrapped by this ServiceDescriptor.
sourcepub fn methods(&self) -> impl ExactSizeIterator<Item = MethodDescriptor> + '_
pub fn methods(&self) -> impl ExactSizeIterator<Item = MethodDescriptor> + '_
Gets an iterator yielding a MethodDescriptor for each method defined in this service.
Trait Implementations
sourceimpl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
sourcefn clone(&self) -> ServiceDescriptor
fn clone(&self) -> ServiceDescriptor
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 ServiceDescriptor
impl Debug for ServiceDescriptor
sourceimpl PartialEq<ServiceDescriptor> for ServiceDescriptor
impl PartialEq<ServiceDescriptor> for ServiceDescriptor
sourcefn eq(&self, other: &ServiceDescriptor) -> bool
fn eq(&self, other: &ServiceDescriptor) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ServiceDescriptor) -> bool
fn ne(&self, other: &ServiceDescriptor) -> bool
This method tests for !=.
impl Eq for ServiceDescriptor
impl StructuralEq for ServiceDescriptor
impl StructuralPartialEq for ServiceDescriptor
Auto Trait Implementations
impl RefUnwindSafe for ServiceDescriptor
impl Send for ServiceDescriptor
impl Sync for ServiceDescriptor
impl Unpin for ServiceDescriptor
impl UnwindSafe for ServiceDescriptor
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