pub trait SquelService:
Clone
+ MaybeSend
+ MaybeSync
+ 'static {
// Required methods
fn schema(&self) -> impl Future<Output = SchemaInfo> + MaybeSend;
fn list(
&self,
request: ListRequest,
) -> impl Future<Output = Result<ListResponse, DibsError>> + MaybeSend;
fn get(
&self,
request: GetRequest,
) -> impl Future<Output = Result<Option<Row>, DibsError>> + MaybeSend;
fn create(
&self,
request: CreateRequest,
) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend;
fn update(
&self,
request: UpdateRequest,
) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend;
fn delete(
&self,
request: DeleteRequest,
) -> impl Future<Output = Result<u64, DibsError>> + MaybeSend;
}Expand description
The Squel service trait - the data plane.
Provides generic CRUD operations for any registered table. Used by admin UIs that dynamically discover and interact with the schema.
Named “Squel” as a cute play on SQL.
Required Methods§
Sourcefn schema(&self) -> impl Future<Output = SchemaInfo> + MaybeSend
fn schema(&self) -> impl Future<Output = SchemaInfo> + MaybeSend
Get the schema for all registered tables.
Sourcefn list(
&self,
request: ListRequest,
) -> impl Future<Output = Result<ListResponse, DibsError>> + MaybeSend
fn list( &self, request: ListRequest, ) -> impl Future<Output = Result<ListResponse, DibsError>> + MaybeSend
List rows from a table with filtering, sorting, and pagination.
Sourcefn get(
&self,
request: GetRequest,
) -> impl Future<Output = Result<Option<Row>, DibsError>> + MaybeSend
fn get( &self, request: GetRequest, ) -> impl Future<Output = Result<Option<Row>, DibsError>> + MaybeSend
Get a single row by primary key.
Sourcefn create(
&self,
request: CreateRequest,
) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend
fn create( &self, request: CreateRequest, ) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend
Create a new row.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".