pub struct PrimaryKey {
pub columns: Vec<PrimaryKeyColumn>,
}
Expand description
主键容器
Fields§
§columns: Vec<PrimaryKeyColumn>
Implementations§
Source§impl PrimaryKey
impl PrimaryKey
pub fn new() -> Self
Sourcepub fn column(self, pk_col: PrimaryKeyColumn) -> Self
pub fn column(self, pk_col: PrimaryKeyColumn) -> Self
添加一个主键列
Sourcepub fn columns(
self,
pk_cols: impl IntoIterator<Item = PrimaryKeyColumn>,
) -> Self
pub fn columns( self, pk_cols: impl IntoIterator<Item = PrimaryKeyColumn>, ) -> 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_inf_min(self, name: &str) -> Self
pub fn column_inf_min(self, name: &str) -> Self
添加一个极小值列。范围查询时可以使用
Sourcepub fn column_info_max(self, name: &str) -> Self
pub fn column_info_max(self, name: &str) -> Self
添加一个极大值列。范围查询时可以使用
Sourcepub fn column_auto_increment(self, name: &str) -> Self
pub fn column_auto_increment(self, name: &str) -> Self
添加一个自增主键列。这个主要是在写入数据的使用用得到,查询的时候用不上
Trait Implementations§
Source§impl Clone for PrimaryKey
impl Clone for PrimaryKey
Source§fn clone(&self) -> PrimaryKey
fn clone(&self) -> PrimaryKey
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 PrimaryKey
impl Debug for PrimaryKey
Source§impl Default for PrimaryKey
impl Default for PrimaryKey
Source§fn default() -> PrimaryKey
fn default() -> PrimaryKey
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PrimaryKey
impl RefUnwindSafe for PrimaryKey
impl Send for PrimaryKey
impl Sync for PrimaryKey
impl Unpin for PrimaryKey
impl UnwindSafe for PrimaryKey
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