pub struct Row {
pub primary_key: PrimaryKey,
pub columns: Vec<Column>,
pub deleted: bool,
}
Expand description
宽表模型的行
Fields§
§primary_key: PrimaryKey
主键列
columns: Vec<Column>
数据列
deleted: bool
是否要删除行
Implementations§
Source§impl Row
impl Row
pub fn new() -> Self
Sourcepub fn get_primary_key_value(&self, name: &str) -> Option<&PrimaryKeyValue>
pub fn get_primary_key_value(&self, name: &str) -> Option<&PrimaryKeyValue>
获取给定名称的主键的值
Sourcepub fn get_column_value(&self, name: &str) -> Option<&ColumnValue>
pub fn get_column_value(&self, name: &str) -> Option<&ColumnValue>
获取给定名称的列的值, 适用于列在行中只出现一次的情况
Sourcepub fn primary_key(self, pk: PrimaryKey) -> Self
pub fn primary_key(self, pk: PrimaryKey) -> Self
设置主键
Sourcepub fn primary_key_column(self, pk_col: PrimaryKeyColumn) -> Self
pub fn primary_key_column(self, pk_col: PrimaryKeyColumn) -> Self
添加一个主键列
Sourcepub fn primary_key_columns(
self,
pk_cols: impl IntoIterator<Item = PrimaryKeyColumn>,
) -> Self
pub fn primary_key_columns( self, pk_cols: impl IntoIterator<Item = PrimaryKeyColumn>, ) -> Self
设置全部主键列
Sourcepub fn primary_key_column_string(
self,
name: &str,
value: impl Into<String>,
) -> Self
pub fn primary_key_column_string( self, name: &str, value: impl Into<String>, ) -> Self
添加字符串类型的主键值
Sourcepub fn primary_key_column_integer(self, name: &str, value: i64) -> Self
pub fn primary_key_column_integer(self, name: &str, value: i64) -> Self
添加整数类型的主键值
Sourcepub fn primary_key_column_binary(
self,
name: &str,
value: impl Into<Vec<u8>>,
) -> Self
pub fn primary_key_column_binary( self, name: &str, value: impl Into<Vec<u8>>, ) -> Self
添加二进制类型的主键值
Sourcepub fn primary_key_column_auto_increment(self, name: &str) -> Self
pub fn primary_key_column_auto_increment(self, name: &str) -> Self
添加自增主键列
Sourcepub fn columns(self, cols: impl IntoIterator<Item = Column>) -> Self
pub fn columns(self, cols: impl IntoIterator<Item = Column>) -> Self
设置列
Sourcepub fn column_string(self, name: &str, value: impl Into<String>) -> Self
pub fn column_string(self, name: &str, value: impl Into<String>) -> Self
添加/更新字符串类型的列
Sourcepub fn column_integer(self, name: &str, value: i64) -> Self
pub fn column_integer(self, name: &str, value: i64) -> Self
添加/更新整数列
Sourcepub fn column_double(self, name: &str, value: f64) -> Self
pub fn column_double(self, name: &str, value: f64) -> Self
添加/更新双精度列
Sourcepub fn column_bool(self, name: &str, value: bool) -> Self
pub fn column_bool(self, name: &str, value: bool) -> Self
添加/更新布尔值列
Sourcepub fn column_to_increse(self, name: &str, inc: i64) -> Self
pub fn column_to_increse(self, name: &str, inc: i64) -> Self
添加要递增值的列。这个是用在 UpdateRow 的时候使用的
Sourcepub fn column_to_delete(self, name: &str, timestamp: u64) -> Self
pub fn column_to_delete(self, name: &str, timestamp: u64) -> Self
添加要删除指定版本值的列
Sourcepub fn column_to_delete_all_versions(self, name: &str) -> Self
pub fn column_to_delete_all_versions(self, name: &str) -> Self
添加要删除全部版本的列
Sourcepub fn delete_marker(self) -> Self
pub fn delete_marker(self) -> Self
添加行删除标记。这个仅在删除行的时候用得到
Trait Implementations§
Source§impl From<Row> for TimeseriesRow
从宽表行转换出来时序行
impl From<Row> for TimeseriesRow
从宽表行转换出来时序行
Source§impl From<TimeseriesRow> for Row
impl From<TimeseriesRow> for Row
Source§fn from(value: TimeseriesRow) -> Self
fn from(value: TimeseriesRow) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
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