pub struct BigTableConnection {
access_token: Option<AccessToken>,
channel: Channel,
table_prefix: String,
app_profile_id: String,
timeout: Option<Duration>,
}
Fields§
§access_token: Option<AccessToken>
§channel: Channel
§table_prefix: String
§app_profile_id: String
§timeout: Option<Duration>
Implementations§
source§impl BigTableConnection
impl BigTableConnection
sourcepub async fn new(
instance_name: &str,
app_profile_id: &str,
read_only: bool,
timeout: Option<Duration>,
credential_type: CredentialType
) -> Result<Self, Error>
pub async fn new( instance_name: &str, app_profile_id: &str, read_only: bool, timeout: Option<Duration>, credential_type: CredentialType ) -> Result<Self, Error>
Establish a connection to the BigTable instance named instance_name
. If read-only access
is required, the read_only
flag should be used to reduce the requested OAuth2 scope.
The GOOGLE_APPLICATION_CREDENTIALS environment variable will be used to determine the program name that contains the BigTable instance in addition to access credentials.
The BIGTABLE_EMULATOR_HOST environment variable is also respected.
The BIGTABLE_PROXY environment variable is used to configure the gRPC connection through a forward proxy (see HTTP_PROXY).
pub fn new_for_emulator( instance_name: &str, app_profile_id: &str, endpoint: &str, timeout: Option<Duration> ) -> Result<Self, Error>
sourcepub fn client(
&self
) -> BigTable<impl FnMut(Request<()>) -> Result<Request<()>, Status>>
pub fn client( &self ) -> BigTable<impl FnMut(Request<()>) -> Result<Request<()>, Status>>
Create a new BigTable client.
Clients require &mut self
, due to Tonic::transport::Channel
limitations, however
creating new clients is cheap and thus can be used as a work around for ease of use.
pub async fn put_bincode_cells_with_retry<T>( &self, table: &str, cells: &[(String, T)] ) -> Result<usize, Error>where T: Serialize,
pub async fn delete_rows_with_retry( &self, table: &str, row_keys: &[String] ) -> Result<(), Error>
pub async fn get_bincode_cells_with_retry<T>( &self, table: &str, row_keys: &[String] ) -> Result<Vec<(String, Result<T, Error>)>, Error>where T: DeserializeOwned,
pub async fn put_protobuf_cells_with_retry<T>( &self, table: &str, cells: &[(String, T)] ) -> Result<usize, Error>where T: Message,
Trait Implementations§
source§impl Clone for BigTableConnection
impl Clone for BigTableConnection
source§fn clone(&self) -> BigTableConnection
fn clone(&self) -> BigTableConnection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BigTableConnection
impl Send for BigTableConnection
impl Sync for BigTableConnection
impl Unpin for BigTableConnection
impl !UnwindSafe for BigTableConnection
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T
in a tonic::Request