pub trait RegulatoryReceiptSource: Send + Sync {
// Required method
fn query_receipts(
&self,
query: &RegulatoryReceiptsQuery,
) -> Result<RegulatoryReceiptQueryResult, RegulatoryApiError>;
}Expand description
Pluggable source for regulatory receipt queries.
Substrate adapters pass a concrete implementation (usually an
chio-store-sqlite wrapper) into [handle_regulatory_receipts].
Keeping this as a trait avoids an chio-http-core -> chio-store-sqlite
dependency while letting callers back the endpoint with any
storage layer.
Required Methods§
Sourcefn query_receipts(
&self,
query: &RegulatoryReceiptsQuery,
) -> Result<RegulatoryReceiptQueryResult, RegulatoryApiError>
fn query_receipts( &self, query: &RegulatoryReceiptsQuery, ) -> Result<RegulatoryReceiptQueryResult, RegulatoryApiError>
Return receipts matching the query. Implementations should
respect the caller’s limit and return the matching_receipts
count independent of the limit.