Skip to main content

Module rest

Module rest 

Source
Expand description

REST API adapter for Vantage.

Wraps an HTTP JSON endpoint as a TableSource. Conditions on tables become URL query parameters, pagination is appended, and responses are parsed against a configurable ResponseShape. CBOR values flow end-to-end, bridging cleanly into the Vista universal surface.

See also: the graphql sibling module for a query-language-based HTTP API adapter.

Re-exports§

pub use vista::ApiColumnExtras;
pub use vista::ApiReferenceExtras;
pub use vista::ApiTableBlock;
pub use vista::ApiTableExtras;
pub use vista::RestApiTableShell;
pub use vista::RestApiVistaFactory;
pub use vista::RestApiVistaSpec;

Modules§

vista
Vista bridge for the REST API backend.

Structs§

OrderingParams
How the API takes a sort: one query param naming the column, with a prefix that flips it to descending (?ordering=-net, the Django REST Framework and Launch Library convention). Configuring it makes the REST vista orderable, so a paged grid asks the server for its sort instead of re-sorting the rows it happens to hold.
PaginationParams
Names of the paging query parameters the API expects, and what the position parameter counts.
RestApi
REST API backend for Vantage — reads data from HTTP JSON endpoints.
RestApiBuilder
Builder for RestApi. Lets callers pick a ResponseShape and override the pagination parameter names.

Enums§

FilterStrategy
How a table’s conditions are applied to a request.
PaginationMode
What the position parameter of PaginationParams counts.
ResponseShape
How the API wraps its row array in the response body.

Functions§

eq_condition
Build an eq condition field = value for Table<RestApi, _>.