google-cloud-bigquery 0.17.0-preview

Google Cloud Client Libraries for Rust - BigQuery
Documentation
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

//! Traits to mock the clients in this library.
//!
//! Application developers may need to mock the clients in this library to test
//! how their application works with different (and sometimes hard to trigger)
//! client and service behavior. Such test can define mocks implementing the
//! trait(s) defined in this module, initialize the client with an instance of
//! this mock in their tests, and verify their application responds as expected.

#![allow(rustdoc::broken_intra_doc_links)]

pub(crate) mod dynamic;

/// Defines the trait used to implement [super::client::Read].
///
/// Application developers may need to implement this trait to mock
/// `client::Read`.  In other use-cases, application developers only
/// use `client::Read` and need not be concerned with this trait or
/// its implementations.
///
/// Services gain new RPCs routinely. Consequently, this trait gains new methods
/// too. To avoid breaking applications the trait provides a default
/// implementation of each method. Most of these implementations just return an
/// error.
pub trait Read: std::fmt::Debug + Send + Sync {
    /// Implements [super::client::Read::create_read_session].
    fn create_read_session(
        &self,
        _req: crate::write::generated::gapic_storage::model::CreateReadSessionRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<crate::write::generated::gapic_storage::model::ReadSession>,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::Read::read_rows].
    fn read_rows(
        &self,
        _req: crate::write::generated::gapic_storage::model::ReadRowsRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            google_cloud_gax::streaming::ResponseStream<
                crate::write::generated::gapic_storage::model::ReadRowsResponse,
            >,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_server_streaming_stub()
    }

    /// Implements [super::client::Read::split_read_stream].
    fn split_read_stream(
        &self,
        _req: crate::write::generated::gapic_storage::model::SplitReadStreamRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<crate::write::generated::gapic_storage::model::SplitReadStreamResponse>,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }
}

/// Defines the trait used to implement [super::client::BigQueryWrite].
///
/// Application developers may need to implement this trait to mock
/// `client::BigQueryWrite`.  In other use-cases, application developers only
/// use `client::BigQueryWrite` and need not be concerned with this trait or
/// its implementations.
///
/// Services gain new RPCs routinely. Consequently, this trait gains new methods
/// too. To avoid breaking applications the trait provides a default
/// implementation of each method. Most of these implementations just return an
/// error.
pub trait BigQueryWrite: std::fmt::Debug + Send + Sync {
    /// Implements [super::client::BigQueryWrite::create_write_stream].
    fn create_write_stream(
        &self,
        _req: crate::write::generated::gapic_storage::model::CreateWriteStreamRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<crate::write::generated::gapic_storage::model::WriteStream>,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::BigQueryWrite::append_rows].
    fn append_rows(
        &self,
        _options: crate::RequestOptions,
    ) -> (
        google_cloud_gax::streaming::RequestSender<
            crate::write::generated::gapic_storage::model::AppendRowsRequest,
        >,
        google_cloud_gax::streaming::ResponseStream<
            crate::write::generated::gapic_storage::model::AppendRowsResponse,
        >,
    ) {
        gaxi::unimplemented::unimplemented_bidi_stub()
    }

    /// Implements [super::client::BigQueryWrite::get_write_stream].
    fn get_write_stream(
        &self,
        _req: crate::write::generated::gapic_storage::model::GetWriteStreamRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<crate::write::generated::gapic_storage::model::WriteStream>,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::BigQueryWrite::finalize_write_stream].
    fn finalize_write_stream(
        &self,
        _req: crate::write::generated::gapic_storage::model::FinalizeWriteStreamRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<
                crate::write::generated::gapic_storage::model::FinalizeWriteStreamResponse,
            >,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::BigQueryWrite::batch_commit_write_streams].
    fn batch_commit_write_streams(
        &self,
        _req: crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<
                crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsResponse,
            >,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }

    /// Implements [super::client::BigQueryWrite::flush_rows].
    fn flush_rows(
        &self,
        _req: crate::write::generated::gapic_storage::model::FlushRowsRequest,
        _options: crate::RequestOptions,
    ) -> impl std::future::Future<
        Output = crate::Result<
            crate::Response<crate::write::generated::gapic_storage::model::FlushRowsResponse>,
        >,
    > + Send {
        gaxi::unimplemented::unimplemented_stub()
    }
}