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 for ServiceDescriptor
impl PartialEq for ServiceDescriptor
impl Eq for ServiceDescriptor
impl StructuralPartialEq for ServiceDescriptor
Auto Trait Implementations§
impl Freeze for ServiceDescriptor
impl RefUnwindSafe for ServiceDescriptor
impl Send for ServiceDescriptor
impl Sync for ServiceDescriptor
impl Unpin for ServiceDescriptor
impl UnwindSafe for ServiceDescriptor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)