pub struct Cpo<DB> where
DB: Store, { /* private fields */ }Expand description
Cpo implements the CPO role of the OCPI Protocol.
Every module supplies an implementation of it self on this type.
Implementations
sourceimpl<DB> Cpo<DB> where
DB: Store,
impl<DB> Cpo<DB> where
DB: Store,
sourcepub fn new(base_url: Url, db: DB, client: Client) -> Self
pub fn new(base_url: Url, db: DB, client: Client) -> Self
Creates a new Cpo instance.
the base_url must be the url to the base ocpi endpoint.
NOT the versions module.
This base url will be used to add on each module url.
so versions will be appended and the versions module
should be served from that path.
Trait Implementations
sourceimpl<Db, M, Tm> CredentialsModule for Cpo<Db> where
M: Party + Send + 'static,
Tm: Send + 'static,
Db: PartyStore<PartyModel = M, TemporaryModel = Tm> + Sync,
impl<Db, M, Tm> CredentialsModule for Cpo<Db> where
M: Party + Send + 'static,
Tm: Send + 'static,
Db: PartyStore<PartyModel = M, TemporaryModel = Tm> + Sync,
sourcefn credentials_post<'life0, 'async_trait>(
&'life0 self,
ctx: Context<Self::TemporaryModel>,
param: Credential
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn credentials_post<'life0, 'async_trait>(
&'life0 self,
ctx: Context<Self::TemporaryModel>,
param: Credential
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Provides credentials for the Server to access the Clients system. This is done using the Temporary model. If this the authentication of the provided Credential is succesful
The provided Credentials will be used to create a new Model. The Credentials for this new Model is what is returned.
type PartyModel = M
type TemporaryModel = Tm
sourcefn credentials_get<'life0, 'async_trait>(
&'life0 self,
ctx: Context<Self::PartyModel>
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn credentials_get<'life0, 'async_trait>(
&'life0 self,
ctx: Context<Self::PartyModel>
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
7.2.1. GET Method Read more
sourcefn credentials_put<'life0, 'async_trait>(
&'life0 self,
ctx: Context<Self::PartyModel>,
param: Credential
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn credentials_put<'life0, 'async_trait>(
&'life0 self,
ctx: Context<Self::PartyModel>,
param: Credential
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
7.2.3. PUT Method Read more
sourceimpl<DB> VersionsModule for Cpo<DB> where
DB: Store,
impl<DB> VersionsModule for Cpo<DB> where
DB: Store,
sourcefn versions_get_details(
&self,
version_number: VersionNumber
) -> Result<Option<VersionDetails>>
fn versions_get_details(
&self,
version_number: VersionNumber
) -> Result<Option<VersionDetails>>
6.2. Version details endpoint Read more
Auto Trait Implementations
impl<DB> !RefUnwindSafe for Cpo<DB>
impl<DB> Send for Cpo<DB> where
DB: Send,
impl<DB> Sync for Cpo<DB> where
DB: Sync,
impl<DB> Unpin for Cpo<DB> where
DB: Unpin,
impl<DB> !UnwindSafe for Cpo<DB>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more