Available on crate feature
client only.Expand description
HTTP clients for the two roles.
The role is a type parameter, so the compiler enforces what the specification’s scopes describe:
Client<BusinessLogic> can create events, Client<VirtualEndNode> cannot, and asking for
the wrong one is a compile error rather than a 403 in production.
Guide, including a VEN polling loop: https://hupe1980.github.io/openadr/docs/client/.
use openadr::client::{Client, BusinessLogic, Credentials};
let client = Client::<BusinessLogic>::builder("https://vtn.example.com/openadr3/3.1.0")?
.credentials(Credentials::new("client-id", "client-secret"))
.build()?;
let programs = client.programs().list().await?;Structs§
- Business
Logic - Marks a client that acts as business logic.
- Client
- A VTN client.
- Client
Builder - Builds a
Client. - Collection
- Typed access to one collection.
- Credentials
- OAuth2 client-credentials, plus where to redeem them.
- Query
- Filters shared by every list endpoint.
- RawResponse
- One HTTP response, uninterpreted. See
Client::exchange. - Tagged
- A representation and the tag that identifies it.
- Virtual
EndNode - Marks a client that acts as a virtual end node.
Enums§
- Client
Error - Why a request failed.
Traits§
- Role
- Sealed marker for the two roles.