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 more