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§
Sourcefn submit_statement(
&self,
cx: &Cx,
request: SubmitHttpRequest,
) -> impl Future<Output = TransportOutcome<SubmitHttpResponse>>
fn submit_statement( &self, cx: &Cx, request: SubmitHttpRequest, ) -> impl Future<Output = TransportOutcome<SubmitHttpResponse>>
POST /api/v2/statements.
Sourcefn poll_statement(
&self,
cx: &Cx,
request: PollHttpRequest,
) -> impl Future<Output = TransportOutcome<PollHttpResponse>>
fn poll_statement( &self, cx: &Cx, request: PollHttpRequest, ) -> impl Future<Output = TransportOutcome<PollHttpResponse>>
GET /api/v2/statements/{handle}.
Sourcefn fetch_partition(
&self,
cx: &Cx,
request: PartitionHttpRequest,
) -> impl Future<Output = TransportOutcome<PartitionBody>>
fn fetch_partition( &self, cx: &Cx, request: PartitionHttpRequest, ) -> impl Future<Output = TransportOutcome<PartitionBody>>
GET /api/v2/statements/{handle}?partition=N (gzip already decoded).
Sourcefn cancel_after_local_cancel(
&self,
cx: &Cx,
auth: AuthorizationDescriptor,
statement_handle: StatementHandle,
reason: CancelReason,
) -> impl Future<Output = TransportOutcome<CancelHttpResponse>>
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.
Sourcefn cancel_orphaned_statement(
&self,
cx: &Cx,
auth: AuthorizationDescriptor,
statement_handle: StatementHandle,
) -> impl Future<Output = TransportOutcome<CancelHttpResponse>>
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".