pub struct IndexModel {
pub name: Option<String>,
pub columns: Vec<String>,
pub unique: bool,
pub predicate: Option<String>,
}Expand description
普通索引模型(不含主键/唯一约束背书的索引)。
Fields§
§name: Option<String>索引名(可空,数据库会自动命名)
columns: Vec<String>索引字段(按顺序)
unique: bool是否唯一索引
predicate: Option<String>部分索引条件,例如 WHERE deleted_at IS NOT NULL
Trait Implementations§
Source§impl Clone for IndexModel
impl Clone for IndexModel
Source§fn clone(&self) -> IndexModel
fn clone(&self) -> IndexModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 IndexModel
impl Debug for IndexModel
Source§impl<'de> Deserialize<'de> for IndexModel
impl<'de> Deserialize<'de> for IndexModel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for IndexModel
Source§impl PartialEq for IndexModel
impl PartialEq for IndexModel
Source§impl Serialize for IndexModel
impl Serialize for IndexModel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for IndexModel
Auto Trait Implementations§
impl Freeze for IndexModel
impl RefUnwindSafe for IndexModel
impl Send for IndexModel
impl Sync for IndexModel
impl Unpin for IndexModel
impl UnsafeUnpin for IndexModel
impl UnwindSafe for IndexModel
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