pub trait ServiceRpc:
'static
+ Send
+ Sized {
const NAME: &'static str;
// Required methods
fn method(&self) -> &'static str;
fn encode(self, writer: FieldWriter<'_, '_, Resource>) -> Port;
fn compute_size(&mut self, sizer: FieldSizer<'_>);
fn decode(
method: &str,
port: Port,
data: &[u8],
) -> Result<Self, (ServiceRpcError, Port)>;
}
Expand description
Trait for service-specific RPC requests.
Required Associated Constants§
Required Methods§
Sourcefn encode(self, writer: FieldWriter<'_, '_, Resource>) -> Port
fn encode(self, writer: FieldWriter<'_, '_, Resource>) -> Port
Encode the request into a field.
Sourcefn compute_size(&mut self, sizer: FieldSizer<'_>)
fn compute_size(&mut self, sizer: FieldSizer<'_>)
Compute the field size of the request.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.