pub trait ChargingProfilesReceiver:
Send
+ Sync
+ 'static {
// Required methods
fn active_charging_profile(
&self,
session_id: String,
duration_seconds: u64,
response_url: Url,
context: RequestContext,
) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send;
fn set_charging_profile(
&self,
session_id: String,
request: SetChargingProfile,
context: RequestContext,
) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send;
fn clear_charging_profile(
&self,
session_id: String,
response_url: Url,
context: RequestContext,
) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send;
}server only.Expand description
The CPO side of the Charging Profiles module: accepting profiles for a running session.
Every method here answers twice. The ChargingProfileResponse returned from the method is
the CPO’s own immediate answer — did it understand the request and manage to pass it to the
EVSE — and, when that answer is ACCEPTED, the Charge Point’s eventual verdict follows as a
POST to the response_url the Sender supplied.
The response contains the direct response from the Receiver (Typically CPO), not the response from the EVSE itself, that will be sent via an asynchronous POST on the Sender interface if this response is
ACCEPTED.
Check the response_url before calling it. It comes from the peer; see
UrlPolicy.
Spec: 2.3.0 §mod_charging_profiles_cpo_interface
Required Methods§
Sourcefn active_charging_profile(
&self,
session_id: String,
duration_seconds: u64,
response_url: Url,
context: RequestContext,
) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send
fn active_charging_profile( &self, session_id: String, duration_seconds: u64, response_url: Url, context: RequestContext, ) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send
GET {chargingprofiles}/{session_id}?duration={duration}&response_url={url}.
The active profile itself is not returned here — it arrives at response_url as an
ActiveChargingProfileResult.
Sourcefn set_charging_profile(
&self,
session_id: String,
request: SetChargingProfile,
context: RequestContext,
) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send
fn set_charging_profile( &self, session_id: String, request: SetChargingProfile, context: RequestContext, ) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send
PUT {chargingprofiles}/{session_id} with a SetChargingProfile body.
Sourcefn clear_charging_profile(
&self,
session_id: String,
response_url: Url,
context: RequestContext,
) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send
fn clear_charging_profile( &self, session_id: String, response_url: Url, context: RequestContext, ) -> impl Future<Output = Handled<ChargingProfileResponse>> + Send
DELETE {chargingprofiles}/{session_id}?response_url={url}.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".