pub trait LocationsReceiver:
Send
+ Sync
+ 'static {
// Required methods
fn location(
&self,
owner: PartyRef,
location_id: String,
context: RequestContext,
) -> impl Future<Output = Handled<Location>> + Send;
fn put_location(
&self,
owner: PartyRef,
location: Location,
context: RequestContext,
) -> impl Future<Output = Handled<Created>> + Send;
fn put_evse(
&self,
owner: PartyRef,
location_id: String,
evse: Evse,
context: RequestContext,
) -> impl Future<Output = Handled<Created>> + Send;
fn put_connector(
&self,
owner: PartyRef,
location_id: String,
evse_uid: String,
connector: Connector,
context: RequestContext,
) -> impl Future<Output = Handled<Created>> + Send;
fn patch(
&self,
owner: PartyRef,
location_id: String,
evse_uid: Option<String>,
connector_id: Option<String>,
patch: Patch<Value>,
context: RequestContext,
) -> impl Future<Output = Handled<()>> + Send;
}server only.Expand description
The eMSP side of the Locations module: receiving the Locations another party owns.
These are client-owned objects, so every method carries the owner from the URL. The router
has already checked that the authenticated platform speaks for that party.
An EVSE is never deleted; a removed EVSE gets
statusREMOVED— so there is no delete method here, by design.
Spec: 2.3.0 §mod_locations_emsp_interface
Required Methods§
Sourcefn location(
&self,
owner: PartyRef,
location_id: String,
context: RequestContext,
) -> impl Future<Output = Handled<Location>> + Send
fn location( &self, owner: PartyRef, location_id: String, context: RequestContext, ) -> impl Future<Output = Handled<Location>> + Send
GET {locations}/{cc}/{party}/{location_id} — what this party has stored.
Sourcefn put_location(
&self,
owner: PartyRef,
location: Location,
context: RequestContext,
) -> impl Future<Output = Handled<Created>> + Send
fn put_location( &self, owner: PartyRef, location: Location, context: RequestContext, ) -> impl Future<Output = Handled<Created>> + Send
PUT {locations}/{cc}/{party}/{location_id}.
Returns whether the object was newly created, which decides between HTTP 201 and 200:
HTTP
200 - Okwhen the object already existed and has successfully been updated. HTTP201 - Createdwhen the object has been newly created in the server system.
Sourcefn put_evse(
&self,
owner: PartyRef,
location_id: String,
evse: Evse,
context: RequestContext,
) -> impl Future<Output = Handled<Created>> + Send
fn put_evse( &self, owner: PartyRef, location_id: String, evse: Evse, context: RequestContext, ) -> impl Future<Output = Handled<Created>> + Send
PUT {locations}/{cc}/{party}/{location_id}/{evse_uid}.
Sourcefn put_connector(
&self,
owner: PartyRef,
location_id: String,
evse_uid: String,
connector: Connector,
context: RequestContext,
) -> impl Future<Output = Handled<Created>> + Send
fn put_connector( &self, owner: PartyRef, location_id: String, evse_uid: String, connector: Connector, context: RequestContext, ) -> impl Future<Output = Handled<Created>> + Send
PUT {locations}/{cc}/{party}/{location_id}/{evse_uid}/{connector_id}.
Sourcefn patch(
&self,
owner: PartyRef,
location_id: String,
evse_uid: Option<String>,
connector_id: Option<String>,
patch: Patch<Value>,
context: RequestContext,
) -> impl Future<Output = Handled<()>> + Send
fn patch( &self, owner: PartyRef, location_id: String, evse_uid: Option<String>, connector_id: Option<String>, patch: Patch<Value>, context: RequestContext, ) -> impl Future<Output = Handled<()>> + Send
PATCH on any of the three levels.
The patch is guaranteed to carry last_updated; the extractor refuses one that does not.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl LocationsReceiver for MockPeer
testkit only.