pub trait CommandsReceiver:
Send
+ Sync
+ 'static {
// Required method
fn command(
&self,
command: Command,
context: RequestContext,
) -> impl Future<Output = Handled<CommandResponse>> + Send;
}Available on crate feature
server only.Expand description
The CPO side of the Commands module: receiving commands from an eMSP.
A command is answered twice: immediately with a
CommandResponse carrying a timeout, and later by
POSTing a CommandResult to the command’s
response_url. This trait covers the first; the second is an outgoing request the
implementation makes when the Charge Point answers.
Check the response_url before calling it. It comes from the peer, and a party that
fetches it unconditionally is an SSRF proxy; the client does this check for
you.
Spec: 2.3.0 §mod_commands_commands_module
Required Methods§
Sourcefn command(
&self,
command: Command,
context: RequestContext,
) -> impl Future<Output = Handled<CommandResponse>> + Send
fn command( &self, command: Command, context: RequestContext, ) -> impl Future<Output = Handled<CommandResponse>> + Send
POST {commands}/{command}.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".