pub struct MockRpcClient { /* private fields */ }
Expand description
A client for performing Remote Procedure Calls (RPC) on (other) uEntities.
Please refer to the Communication Layer API specification for details.
Implementations§
Source§impl MockRpcClient
impl MockRpcClient
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
Source§impl MockRpcClient
impl MockRpcClient
Sourcepub fn expect_invoke_method(&mut self) -> &mut Expectation
pub fn expect_invoke_method(&mut self) -> &mut Expectation
Create an Expectation
for mocking the invoke_method
method
Trait Implementations§
Source§impl Debug for MockRpcClient
impl Debug for MockRpcClient
Source§impl Default for MockRpcClient
impl Default for MockRpcClient
Source§impl RpcClient for MockRpcClient
A client for performing Remote Procedure Calls (RPC) on (other) uEntities.
impl RpcClient for MockRpcClient
A client for performing Remote Procedure Calls (RPC) on (other) uEntities.
Please refer to the Communication Layer API specification for details.
Source§fn invoke_method<'life0, 'async_trait>(
&'life0 self,
method: UUri,
call_options: CallOptions,
payload: Option<UPayload>,
) -> Pin<Box<dyn Future<Output = Result<Option<UPayload>, ServiceInvocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke_method<'life0, 'async_trait>(
&'life0 self,
method: UUri,
call_options: CallOptions,
payload: Option<UPayload>,
) -> Pin<Box<dyn Future<Output = Result<Option<UPayload>, ServiceInvocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invokes a method on a service.
§Arguments
method
- The URI representing the method to invoke.call_options
- Options to include in the request message.payload
- The (optional) payload to include in the request message.
§Returns
The payload returned by the service operation.
§Errors
Returns an error if invocation fails or the given arguments cannot be turned into a valid RPC Request message.