pub struct ChargingProfilesClient<'a>(/* private fields */);client only.Expand description
Drives a CPO’s Charging Profiles Receiver interface, as an eMSP or SCSP.
Every method here answers twice: the ChargingProfileResponse returned is the CPO’s own
immediate verdict, and — when that is ACCEPTED — the Charge Point’s answer follows at the
response_url, which this party must be serving. Build those URLs with
CallbackUrls if the server side is this crate’s too.
Spec: 2.3.0 §mod_charging_profiles_cpo_interface
Implementations§
Source§impl<'a> ChargingProfilesClient<'a>
impl<'a> ChargingProfilesClient<'a>
Sourcepub const fn new(client: ModuleClient<'a>) -> Self
pub const fn new(client: ModuleClient<'a>) -> Self
Wraps a module client.
Sourcepub async fn active_charging_profile(
&self,
session_id: &str,
duration_seconds: u64,
response_url: &Url,
) -> Result<ChargingProfileResponse, OcpiError>
pub async fn active_charging_profile( &self, session_id: &str, duration_seconds: u64, response_url: &Url, ) -> Result<ChargingProfileResponse, OcpiError>
GET {chargingprofiles}/{session_id}?duration=&response_url=.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub async fn set_charging_profile(
&self,
session_id: &str,
request: &SetChargingProfile,
) -> Result<ChargingProfileResponse, OcpiError>
pub async fn set_charging_profile( &self, session_id: &str, request: &SetChargingProfile, ) -> Result<ChargingProfileResponse, OcpiError>
PUT {chargingprofiles}/{session_id} with a SetChargingProfile body.
§Errors
Propagates validation, transport and OCPI-level errors.
Sourcepub async fn clear_charging_profile(
&self,
session_id: &str,
response_url: &Url,
) -> Result<ChargingProfileResponse, OcpiError>
pub async fn clear_charging_profile( &self, session_id: &str, response_url: &Url, ) -> Result<ChargingProfileResponse, OcpiError>
DELETE {chargingprofiles}/{session_id}?response_url=.
§Errors
Propagates transport and OCPI-level errors.
Sourcepub async fn push_active_charging_profile(
&self,
session_id: &str,
profile: &ActiveChargingProfile,
) -> Result<(), OcpiError>
pub async fn push_active_charging_profile( &self, session_id: &str, profile: &ActiveChargingProfile, ) -> Result<(), OcpiError>
PUT {chargingprofiles}/{session_id} on the Sender interface — a CPO volunteering a
changed active profile to the party that set one.
§Errors
Propagates validation, transport and OCPI-level errors.
Trait Implementations§
Source§impl<'a> Clone for ChargingProfilesClient<'a>
impl<'a> Clone for ChargingProfilesClient<'a>
Source§fn clone(&self) -> ChargingProfilesClient<'a>
fn clone(&self) -> ChargingProfilesClient<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more