spiral-sdk 0.1.9

Rust SDK for Spiral resource and table APIs
Documentation
// Generated by tools/service-contracts/rust.py. Do not edit.
#![doc = "Transport-independent service interface for local and remote calls."]

use async_trait::async_trait;
use spiral_contract::auth::AuthHeader;
use spiral_contract::call::CallError;

use crate::api::usage::objects::*;
/// Service implementations authenticate Authorization headers and enforce resource permissions.
#[async_trait]
pub trait UsageApi: Send + Sync + 'static {
    /// Accept a batch for asynchronous delivery. A successful response means the report passed
    /// authentication and authorization; delivery failures are logged and do not fail the request.
    async fn report_usage(
        &self,
        auth_header: AuthHeader,
        request: ReportUsageRequest,
    ) -> Result<(), CallError<UsageError>>;
}