Struct solana_storage_bigtable::bigtable::BigTable
source · pub struct BigTable<F: FnMut(Request<()>) -> Result<Request<()>, Status>> {
access_token: Option<AccessToken>,
client: BigtableClient<InterceptedService<Channel, F>>,
table_prefix: String,
app_profile_id: String,
timeout: Option<Duration>,
}
Fields§
§access_token: Option<AccessToken>
§client: BigtableClient<InterceptedService<Channel, F>>
§table_prefix: String
§app_profile_id: String
§timeout: Option<Duration>
Implementations§
source§impl<F: FnMut(Request<()>) -> Result<Request<()>, Status>> BigTable<F>
impl<F: FnMut(Request<()>) -> Result<Request<()>, Status>> BigTable<F>
async fn decode_read_rows_response( &self, rrr: Streaming<ReadRowsResponse> ) -> Result<Vec<(String, Vec<(String, Vec<u8>)>)>, Error>
async fn refresh_access_token(&self)
sourcepub async fn get_row_keys(
&mut self,
table_name: &str,
start_at: Option<String>,
end_at: Option<String>,
rows_limit: i64
) -> Result<Vec<String>, Error>
pub async fn get_row_keys( &mut self, table_name: &str, start_at: Option<String>, end_at: Option<String>, rows_limit: i64 ) -> Result<Vec<String>, Error>
Get table
row keys in lexical order.
If start_at
is provided, the row key listing will start with key.
Otherwise the listing will start from the start of the table.
If end_at
is provided, the row key listing will end at the key. Otherwise it will
continue until the rows_limit
is reached or the end of the table, whichever comes first.
If rows_limit
is zero, this method will return an empty array.
sourcepub async fn row_key_exists(
&mut self,
table_name: &str,
row_key: String
) -> Result<bool, Error>
pub async fn row_key_exists( &mut self, table_name: &str, row_key: String ) -> Result<bool, Error>
Check whether a row key exists in a table
sourcepub async fn get_row_data(
&mut self,
table_name: &str,
start_at: Option<String>,
end_at: Option<String>,
rows_limit: i64
) -> Result<Vec<(String, Vec<(String, Vec<u8>)>)>, Error>
pub async fn get_row_data( &mut self, table_name: &str, start_at: Option<String>, end_at: Option<String>, rows_limit: i64 ) -> Result<Vec<(String, Vec<(String, Vec<u8>)>)>, Error>
Get latest data from table
.
All column families are accepted, and only the latest version of each column cell will be returned.
If start_at
is provided, the row key listing will start with key, or the next key in the
table if the explicit key does not exist. Otherwise the listing will start from the start
of the table.
If end_at
is provided, the row key listing will end at the key. Otherwise it will
continue until the rows_limit
is reached or the end of the table, whichever comes first.
If rows_limit
is zero, this method will return an empty array.
sourcepub async fn get_multi_row_data(
&mut self,
table_name: &str,
row_keys: &[String]
) -> Result<Vec<(String, Vec<(String, Vec<u8>)>)>, Error>
pub async fn get_multi_row_data( &mut self, table_name: &str, row_keys: &[String] ) -> Result<Vec<(String, Vec<(String, Vec<u8>)>)>, Error>
Get latest data from multiple rows of table
, if those rows exist.
sourcepub async fn get_single_row_data(
&mut self,
table_name: &str,
row_key: String
) -> Result<Vec<(String, Vec<u8>)>, Error>
pub async fn get_single_row_data( &mut self, table_name: &str, row_key: String ) -> Result<Vec<(String, Vec<u8>)>, Error>
Get latest data from a single row of table
, if that row exists. Returns an error if that
row does not exist.
All column families are accepted, and only the latest version of each column cell will be returned.
sourceasync fn delete_rows(
&mut self,
table_name: &str,
row_keys: &[String]
) -> Result<(), Error>
async fn delete_rows( &mut self, table_name: &str, row_keys: &[String] ) -> Result<(), Error>
Delete one or more table
rows
sourceasync fn put_row_data(
&mut self,
table_name: &str,
family_name: &str,
row_data: &[(&String, Vec<(String, Vec<u8>)>)]
) -> Result<(), Error>
async fn put_row_data( &mut self, table_name: &str, family_name: &str, row_data: &[(&String, Vec<(String, Vec<u8>)>)] ) -> Result<(), Error>
Store data for one or more table
rows in the family_name
Column family
pub async fn get_bincode_cell<T>( &mut self, table: &str, key: String ) -> Result<T, Error>where T: DeserializeOwned,
pub async fn get_bincode_cells<T>( &mut self, table: &str, keys: &[String] ) -> Result<Vec<(String, Result<T, Error>)>, Error>where T: DeserializeOwned,
pub async fn get_protobuf_or_bincode_cell<B, P>( &mut self, table: &str, key: String ) -> Result<CellData<B, P>, Error>where B: DeserializeOwned, P: Message + Default,
pub async fn get_protobuf_or_bincode_cells<'a, B, P>( &mut self, table: &'a str, row_keys: impl IntoIterator<Item = String> ) -> Result<impl Iterator<Item = (String, CellData<B, P>)> + 'a, Error>where B: DeserializeOwned, P: Message + Default,
pub async fn put_bincode_cells<T>( &mut self, table: &str, cells: &[(String, T)] ) -> Result<usize, Error>where T: Serialize,
pub async fn put_protobuf_cells<T>( &mut self, table: &str, cells: &[(String, T)] ) -> Result<usize, Error>where T: Message,
Auto Trait Implementations§
impl<F> !RefUnwindSafe for BigTable<F>
impl<F> Send for BigTable<F>where F: Send,
impl<F> Sync for BigTable<F>where F: Sync,
impl<F> Unpin for BigTable<F>where F: Unpin,
impl<F> !UnwindSafe for BigTable<F>
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> 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