pub struct Client { /* private fields */ }Expand description
Implements the different OCPI calls as a client.
Implementations§
Source§impl Client
impl Client
pub fn new(http: Client) -> Self
Sourcepub async fn get_endpoints_for_version(
&self,
ctx: ExtendedContext<'_>,
versions_url: Url,
desired_version: VersionNumber,
) -> Result<VersionDetails>
pub async fn get_endpoints_for_version( &self, ctx: ExtendedContext<'_>, versions_url: Url, desired_version: VersionNumber, ) -> Result<VersionDetails>
Given a version number and the URL of the root OCPI versions endpoint and the client. The function first calls the versions URL to confirm that the required version exists. And then retrieves the available endpoints for that version.
pub async fn post_response( &self, ctx: ExtendedContext<'_>, url: &Url, command_result: CommandResult, ) -> Result<()>
pub async fn put_session( &self, ctx: &Context, url: &Url, session: Session, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more