Expand description
Vantage adapters for HTTP-based API backends.
Two protocol adapters live side by side:
rest— generic REST API client. MapsTable<RestApi, E>toGET {base_url}/{table_name}with eq-conditions and pagination peeled into the URL query string.graphql— GraphQL API client. Renders typed query documents with inline filters + variable-typed pagination, supports both Hasura and flat-argument (e.g. SpaceX) dialects, and bridges into Vista via a YAML schema map.
Every type a caller needs is re-exported here; see prelude for a
one-stop import. Requests go through vantage-api-pool’s
ResilientClient, whose types are re-exported too. The HTTP client
is reqwest 0.12, which appears in the public API
(RestApiBuilder::http_client, RestApi::http_request).
Re-exports§
pub use graphql::AnyGraphqlType;pub use graphql::CountMode;pub use graphql::FieldCondition;pub use graphql::FilterDialect;pub use graphql::GraphqlApi;pub use graphql::GraphqlApiBuilder;pub use graphql::GraphqlApiTableShell;pub use graphql::GraphqlApiVistaFactory;pub use graphql::GraphqlApiVistaSpec;pub use graphql::GraphqlBlock;pub use graphql::GraphqlColumnBlock;pub use graphql::GraphqlColumnExtras;pub use graphql::GraphqlCondition;pub use graphql::GraphqlOp;pub use graphql::GraphqlOperation;pub use graphql::GraphqlSelect;pub use graphql::GraphqlTableExtras;pub use graphql::GraphqlType;pub use graphql::GraphqlTypeVariants;pub use graphql::RenderedQuery;pub use graphql::Supports;pub use rest::ApiColumnExtras;pub use rest::ApiReferenceExtras;pub use rest::ApiTableBlock;pub use rest::ApiTableExtras;pub use rest::FilterStrategy;pub use rest::OrderingParams;pub use rest::PaginationMode;pub use rest::PaginationParams;pub use rest::ResponseShape;pub use rest::RestApi;pub use rest::RestApiBuilder;pub use rest::RestApiTableShell;pub use rest::RestApiVistaFactory;pub use rest::RestApiVistaSpec;pub use rest::eq_condition;
Modules§
- graphql
- GraphQL adapter for Vantage.
- prelude
- Convenience prelude —
use vantage_api_client::prelude::*;pulls in the public surface of both adapter modules in one shot. - rest
- REST API adapter for Vantage.
Structs§
- Call
Policy - The policy for one call.
- Client
Error - The failure of a call, once its retries (if any) are used up. The client
produces these;
ClientError::newexists for consumers that need to fabricate one, such as a test double forTransportEvent::Failed. - Resilient
Client - A cheap-to-clone resilient HTTP client. Build via
ResilientClient::builder. - Resilient
Client Builder - Builder for
ResilientClient. - Retry
Policy - Bounded retry: exponential from
base_backoff(doubling per attempt), capped atmax_backoff, with jitter added before each sleep.
Enums§
- Breaker
Mode - What an attempt does while the circuit breaker is open.
- Breaker
State - What a
ResilientClient’s breaker is doing right now, for consumers that poll instead of trackingTransportEvents. - Error
Kind - Why a call failed. New kinds may be added; match with a wildcard arm.
- Priority
- Whether someone is waiting on the result of the request about to be sent. Transports choose their retry policy from it.
- Retry
Mode - How many times, and how long apart, a failed attempt is repeated.
- Transport
Event - One thing a client reports to its
TransportObserver. New events may be added; match with a wildcard arm.
Traits§
- Transport
Observer - Receives a client’s
TransportEvents.
Type Aliases§
- Auth
Future - Future returned by the auth token refresher.
- Auth
Refresher - Acquire (or re-acquire) an auth token — called lazily and on
401. - Bearer
Source - Where a request’s bearer token comes from when it differs per caller:
asked each time a request goes out, retries included, and answering
the bare token (
Beareris prepended).Nonesends noAuthorizationheader on that request.