pub struct ServiceDescriptor {
pub name: String,
pub operations: Vec<OperationDescriptor>,
}Expand description
Service descriptor for codegen — collection of OperationDescriptors.
Fields§
§name: StringIDL-Interface-Name.
operations: Vec<OperationDescriptor>Operations in IDL order.
Implementations§
Source§impl ServiceDescriptor
impl ServiceDescriptor
Sourcepub fn add_operation(
&mut self,
name: impl Into<String>,
one_way: bool,
in_params: Vec<String>,
out_params: Vec<String>,
) -> RpcResult<&OperationDescriptor>
pub fn add_operation( &mut self, name: impl Into<String>, one_way: bool, in_params: Vec<String>, out_params: Vec<String>, ) -> RpcResult<&OperationDescriptor>
Registers an operation. The opcode is assigned automatically.
§Errors
RpcError::Codec if the operation count exceeds u32::MAX.
Sourcepub fn operation(&self, name: &str) -> Option<&OperationDescriptor>
pub fn operation(&self, name: &str) -> Option<&OperationDescriptor>
Lookup by name.
Sourcepub fn operation_by_opcode(&self, opcode: u32) -> Option<&OperationDescriptor>
pub fn operation_by_opcode(&self, opcode: u32) -> Option<&OperationDescriptor>
Lookup by opcode.
Trait Implementations§
Source§impl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
Source§fn clone(&self) -> ServiceDescriptor
fn clone(&self) -> ServiceDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceDescriptor
impl Debug for ServiceDescriptor
Source§impl Default for ServiceDescriptor
impl Default for ServiceDescriptor
Source§fn default() -> ServiceDescriptor
fn default() -> ServiceDescriptor
Returns the “default value” for a type. Read more
impl Eq for ServiceDescriptor
Source§impl PartialEq for ServiceDescriptor
impl PartialEq for ServiceDescriptor
Source§fn eq(&self, other: &ServiceDescriptor) -> bool
fn eq(&self, other: &ServiceDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more