pub trait TokensSender:
Send
+ Sync
+ 'static {
// Required methods
fn list(
&self,
query: PageQuery,
context: RequestContext,
) -> impl Future<Output = Handled<Page<Token>>> + Send;
fn authorize(
&self,
token_uid: String,
token_type: Option<TokenType>,
location: Option<LocationReferences>,
context: RequestContext,
) -> impl Future<Output = Handled<AuthorizationInfo>> + Send;
}Available on crate feature
server only.Expand description
The eMSP side of the Tokens module: serving Tokens and answering real-time authorizations.
Spec: 2.3.0 §mod_tokens_emsp_interface
Required Methods§
Sourcefn list(
&self,
query: PageQuery,
context: RequestContext,
) -> impl Future<Output = Handled<Page<Token>>> + Send
fn list( &self, query: PageQuery, context: RequestContext, ) -> impl Future<Output = Handled<Page<Token>>> + Send
GET {tokens} — one page of Tokens.
POST {tokens}/{token_uid}/authorize[?type=] — a real-time authorization.
2004 Unknown Tokenis the code for a token this party does not know; returnOcpiError::Remotewith that code, or anAuthorizationInfowithAllowedType::NotAllowedwhen the token is known but may not charge here.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl TokensSender for MockPeer
Available on crate feature
testkit only.