Struct prost_reflect::ServiceDescriptor
source · pub struct ServiceDescriptor { /* private fields */ }Expand description
A protobuf service definition.
Implementations§
source§impl ServiceDescriptor
impl ServiceDescriptor
sourcepub fn new(pool: DescriptorPool, index: usize) -> Self
pub fn new(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 parent_file(&self) -> FileDescriptor
pub fn parent_file(&self) -> FileDescriptor
Gets the FileDescriptor 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 path(&self) -> &[i32]
pub fn path(&self) -> &[i32]
Gets the path where this service is defined within the FileDescriptorProto, e.g. [6, 0].
See path for more details on the structure of the path.
sourcepub fn parent_file_descriptor_proto(&self) -> &FileDescriptorProto
pub fn parent_file_descriptor_proto(&self) -> &FileDescriptorProto
Gets a reference to the FileDescriptorProto in which this service is defined.
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 options(&self) -> DynamicMessage
pub fn options(&self) -> DynamicMessage
Decodes the options defined for this ServiceDescriptorProto, including any extension options.
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§
source§impl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
source§fn clone(&self) -> ServiceDescriptor
fn clone(&self) -> ServiceDescriptor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ServiceDescriptor
impl Debug for ServiceDescriptor
source§impl PartialEq<ServiceDescriptor> for ServiceDescriptor
impl PartialEq<ServiceDescriptor> for ServiceDescriptor
source§fn eq(&self, other: &ServiceDescriptor) -> bool
fn eq(&self, other: &ServiceDescriptor) -> bool
self and other values to be equal, and is used
by ==.