pub struct TableInBatchGetRowRequest {
pub table_name: String,
pub primary_keys: Vec<PrimaryKey>,
pub columns_to_get: HashSet<String>,
pub time_range_start_ms: Option<i64>,
pub time_range_end_ms: Option<i64>,
pub time_range_specific_ms: Option<i64>,
pub max_versions: Option<i32>,
pub start_column: Option<String>,
pub end_column: Option<String>,
}
Expand description
单个表读取数据的配置
Fields§
§table_name: String
§primary_keys: Vec<PrimaryKey>
§columns_to_get: HashSet<String>
§time_range_start_ms: Option<i64>
§time_range_end_ms: Option<i64>
§time_range_specific_ms: Option<i64>
§max_versions: Option<i32>
§start_column: Option<String>
§end_column: Option<String>
Implementations§
Source§impl TableInBatchGetRowRequest
impl TableInBatchGetRowRequest
pub fn new(table_name: &str) -> Self
Sourcepub fn primary_key(self, primary_key: PrimaryKey) -> Self
pub fn primary_key(self, primary_key: PrimaryKey) -> Self
添加一个主键
Sourcepub fn primary_keys(self, pks: impl IntoIterator<Item = PrimaryKey>) -> Self
pub fn primary_keys(self, pks: impl IntoIterator<Item = PrimaryKey>) -> Self
设置多个主键
Sourcepub fn column_to_get(self, name: &str) -> Self
pub fn column_to_get(self, name: &str) -> Self
需要返回的全部列的列名。如果为空,则返回指定行的所有列。columns_to_get
个数不应超过128个。
如果指定的列不存在,则不会返回指定列的数据;如果给出了重复的列名,返回结果只会包含一次指定列。
Sourcepub fn columns_to_get(
self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn columns_to_get( self, names: impl IntoIterator<Item = impl Into<String>>, ) -> Self
设置需要返回的列
Sourcepub fn max_versions(self, max_versions: i32) -> Self
pub fn max_versions(self, max_versions: i32) -> Self
读取数据时,返回的最多版本个数。和 time_range
至少存在一个
如果指定 max_versions
为 2
,则每一列最多返回 2
个版本的数据。
Sourcepub fn time_range(self, start_ms: i64, end_ms: i64) -> Self
pub fn time_range(self, start_ms: i64, end_ms: i64) -> Self
Sourcepub fn specific_time_ms(self, time_ms: i64) -> Self
pub fn specific_time_ms(self, time_ms: i64) -> Self
指定精确的时间戳
Sourcepub fn start_column(self, name: &str) -> Self
pub fn start_column(self, name: &str) -> Self
指定读取时的起始列,主要用于宽行读。列的顺序按照列名的字典序排序。返回的结果中包含当前起始列。
如果一张表有 a
、 b
、 c
三列,读取时指定 start_column
为 b
,则会从 b
列开始读,返回 b
、c
两列。
Sourcepub fn end_column(self, name: &str) -> Self
pub fn end_column(self, name: &str) -> Self
返回的结果中不包含当前结束列。列的顺序按照列名的字典序排序。
如果一张表有 a
、 b
、 c
三列,读取时指定 end_column
为 b
,则读到 b
列时会结束,返回 a
列。
Trait Implementations§
Source§impl Clone for TableInBatchGetRowRequest
impl Clone for TableInBatchGetRowRequest
Source§fn clone(&self) -> TableInBatchGetRowRequest
fn clone(&self) -> TableInBatchGetRowRequest
Returns a duplicate 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 moreSource§impl Debug for TableInBatchGetRowRequest
impl Debug for TableInBatchGetRowRequest
Source§impl Default for TableInBatchGetRowRequest
impl Default for TableInBatchGetRowRequest
Source§fn default() -> TableInBatchGetRowRequest
fn default() -> TableInBatchGetRowRequest
Returns the “default value” for a type. Read more
Source§impl From<TableInBatchGetRowRequest> for TableInBatchGetRowRequest
impl From<TableInBatchGetRowRequest> for TableInBatchGetRowRequest
Source§fn from(value: TableInBatchGetRowRequest) -> Self
fn from(value: TableInBatchGetRowRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TableInBatchGetRowRequest
impl RefUnwindSafe for TableInBatchGetRowRequest
impl Send for TableInBatchGetRowRequest
impl Sync for TableInBatchGetRowRequest
impl Unpin for TableInBatchGetRowRequest
impl UnwindSafe for TableInBatchGetRowRequest
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