Struct bigtable_rs::bigtable::BigTable
source · pub struct BigTable { /* private fields */ }
Expand description
The core struct for Bigtable client, which wraps a gPRC client defined by Bigtable proto.
In order to easily use this struct in multiple threads, we only store cloneable references here.
BigtableClient<AuthSvc>
is a type alias of BigtableClient
and it wraps a tonic Channel.
Cloning on Bigtable
is cheap.
Bigtable can be created via bigtable::BigTableConnection::new()
and cloned
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
use bigtable_rs::bigtable;
let connection = bigtable::BigTableConnection::new("p-id", "i-id", true, 1, None).await?;
let bt_client = connection.client();
// Cheap to clone clients and used in other places.
let bt_client2 = bt_client.clone();
Ok(())
}
Implementations§
source§impl BigTable
impl BigTable
sourcepub async fn check_and_mutate_row(
&mut self,
request: CheckAndMutateRowRequest,
) -> Result<CheckAndMutateRowResponse, Error>
pub async fn check_and_mutate_row( &mut self, request: CheckAndMutateRowRequest, ) -> Result<CheckAndMutateRowResponse, Error>
Wrapped check_and_mutate_row
method
sourcepub async fn read_rows(
&mut self,
request: ReadRowsRequest,
) -> Result<Vec<(Vec<u8>, Vec<RowCell>)>, Error>
pub async fn read_rows( &mut self, request: ReadRowsRequest, ) -> Result<Vec<(Vec<u8>, Vec<RowCell>)>, Error>
Wrapped read_rows
method
sourcepub async fn read_rows_with_prefix(
&mut self,
request: ReadRowsRequest,
prefix: Vec<u8>,
) -> Result<Vec<(Vec<u8>, Vec<RowCell>)>, Error>
pub async fn read_rows_with_prefix( &mut self, request: ReadRowsRequest, prefix: Vec<u8>, ) -> Result<Vec<(Vec<u8>, Vec<RowCell>)>, Error>
Provide read_rows_with_prefix
method to allow using a prefix as key
sourcepub async fn sample_row_keys(
&mut self,
request: SampleRowKeysRequest,
) -> Result<Streaming<SampleRowKeysResponse>, Error>
pub async fn sample_row_keys( &mut self, request: SampleRowKeysRequest, ) -> Result<Streaming<SampleRowKeysResponse>, Error>
Wrapped sample_row_keys
method
sourcepub async fn mutate_row(
&mut self,
request: MutateRowRequest,
) -> Result<Response<MutateRowResponse>, Error>
pub async fn mutate_row( &mut self, request: MutateRowRequest, ) -> Result<Response<MutateRowResponse>, Error>
Wrapped mutate_row
method
sourcepub async fn mutate_rows(
&mut self,
request: MutateRowsRequest,
) -> Result<Streaming<MutateRowsResponse>, Error>
pub async fn mutate_rows( &mut self, request: MutateRowsRequest, ) -> Result<Streaming<MutateRowsResponse>, Error>
Wrapped mutate_rows
method
sourcepub fn get_client(&mut self) -> &mut BigtableClient<AuthSvc>
pub fn get_client(&mut self) -> &mut BigtableClient<AuthSvc>
Provide a convenient method to get the inner BigtableClient
so user can use any methods
defined from the Bigtable V2 gRPC API
sourcepub fn get_full_table_name(&self, table_name: &str) -> String
pub fn get_full_table_name(&self, table_name: &str) -> String
Provide a convenient method to get full table, which can be used for building requests
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BigTable
impl !RefUnwindSafe for BigTable
impl Send for BigTable
impl Sync for BigTable
impl Unpin for BigTable
impl !UnwindSafe for BigTable
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request