Skip to main content

StatementTransport

Trait StatementTransport 

Source
pub trait StatementTransport {
    // Required methods
    fn submit_statement(
        &self,
        cx: &Cx,
        request: SubmitHttpRequest,
    ) -> impl Future<Output = TransportOutcome<SubmitHttpResponse>>;
    fn poll_statement(
        &self,
        cx: &Cx,
        request: PollHttpRequest,
    ) -> impl Future<Output = TransportOutcome<PollHttpResponse>>;
    fn fetch_partition(
        &self,
        cx: &Cx,
        request: PartitionHttpRequest,
    ) -> impl Future<Output = TransportOutcome<PartitionBody>>;
    fn cancel_after_local_cancel(
        &self,
        cx: &Cx,
        auth: AuthorizationDescriptor,
        statement_handle: StatementHandle,
        reason: CancelReason,
    ) -> impl Future<Output = TransportOutcome<CancelHttpResponse>>;
    fn cancel_orphaned_statement(
        &self,
        cx: &Cx,
        auth: AuthorizationDescriptor,
        statement_handle: StatementHandle,
    ) -> impl Future<Output = TransportOutcome<CancelHttpResponse>>;
}
Expand description

The transport operations the driver needs. SnowflakeHttpClient is the production implementation; tests inject a scripted fake so the driver’s error and cancellation paths are provable without a socket or an account.

Required Methods§

Source

fn submit_statement( &self, cx: &Cx, request: SubmitHttpRequest, ) -> impl Future<Output = TransportOutcome<SubmitHttpResponse>>

POST /api/v2/statements.

Source

fn poll_statement( &self, cx: &Cx, request: PollHttpRequest, ) -> impl Future<Output = TransportOutcome<PollHttpResponse>>

GET /api/v2/statements/{handle}.

Source

fn fetch_partition( &self, cx: &Cx, request: PartitionHttpRequest, ) -> impl Future<Output = TransportOutcome<PartitionBody>>

GET /api/v2/statements/{handle}?partition=N (gzip already decoded).

Source

fn cancel_after_local_cancel( &self, cx: &Cx, auth: AuthorizationDescriptor, statement_handle: StatementHandle, reason: CancelReason, ) -> impl Future<Output = TransportOutcome<CancelHttpResponse>>

Policy-routed remote cancel after a local cancellation.

Source

fn cancel_orphaned_statement( &self, cx: &Cx, auth: AuthorizationDescriptor, statement_handle: StatementHandle, ) -> impl Future<Output = TransportOutcome<CancelHttpResponse>>

Best-effort remote cancel when the driver abandons a handle after an error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<H: RawHttp> StatementTransport for SnowflakeHttpClient<H>

Implementors§