spiral-sdk 0.1.7

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 uuid::Uuid;

use crate::api::enrichments::objects::*;
/// Service implementations authenticate Authorization headers and enforce resource permissions.
#[async_trait]
pub trait EnrichmentsApi: Send + Sync + 'static {
    /// Allocate an Enrichment root and private backing storage for its source Table.
    async fn create_enrichment(
        &self,
        auth_header: AuthHeader,
        request: CreateEnrichmentRequest,
    ) -> Result<CreateEnrichmentResponse, CallError<EnrichmentsError>>;
    /// Record an immutable successor of an explicit base. The service structurally validates codec
    /// payloads without initializing an execution engine.
    async fn create_version(
        &self,
        auth_header: AuthHeader,
        enrichment_id: Uuid,
        request: CreateVersionRequest,
    ) -> Result<CreateVersionResponse, CallError<EnrichmentsError>>;
    /// Read the Enrichment root and one exact immutable version.
    async fn read_version(
        &self,
        auth_header: AuthHeader,
        enrichment_id: Uuid,
        version_id: Uuid,
    ) -> Result<ReadVersionResponse, CallError<EnrichmentsError>>;
    /// Obtain short-lived access to the Enrichment storage.
    async fn storage_access(
        &self,
        auth_header: AuthHeader,
        enrichment_id: Uuid,
        request: StorageAccessRequest,
    ) -> Result<StorageAccessResponse, CallError<EnrichmentsError>>;
    /// Obtain renewable typed storage access for the Enrichment.
    async fn storage_binding(
        &self,
        auth_header: AuthHeader,
        enrichment_id: Uuid,
        request: StorageAccessRequest,
    ) -> Result<StorageBinding, CallError<EnrichmentsError>>;
}