pub struct Chain { /* private fields */ }Expand description
条件链。
Implementations§
Source§impl Chain
impl Chain
pub fn new() -> Self
pub fn add_condition(self, condition: Condition) -> Self
pub fn equal( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
Sourcepub fn value_fn(
self,
f: impl Fn() -> ConditionValue + Send + Sync + 'static,
) -> Self
pub fn value_fn( self, f: impl Fn() -> ConditionValue + Send + Sync + 'static, ) -> Self
为最近一次添加的条件设置 value_fn(优先级高于显式 value),贴近 Go 版 WithValueFunc。
Sourcepub fn skip_fn(self, f: impl Fn() -> bool + Send + Sync + 'static) -> Self
pub fn skip_fn(self, f: impl Fn() -> bool + Send + Sync + 'static) -> Self
为最近一次添加的条件设置 skip_fn(优先级高于 skip),贴近 Go 版 WithSkipFunc。
pub fn equal_opts( self, field: impl Into<String>, value: impl Into<ConditionValue>, opts: ChainOptions, ) -> Self
pub fn not_equal( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn is_null(self, field: impl Into<String>) -> Self
pub fn is_not_null(self, field: impl Into<String>) -> Self
pub fn greater_than( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn less_than( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn greater_equal_than( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn less_equal_than( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn like( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn not_like( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn between( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn in_( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn not_in( self, field: impl Into<String>, value: impl Into<ConditionValue>, ) -> Self
pub fn or( self, fields: impl IntoIterator<Item = impl Into<String>>, operators: impl IntoIterator<Item = Operator>, values: impl IntoIterator<Item = impl Into<ConditionValue>>, opts: ChainOptions, ) -> Self
pub fn order_by(self, value: impl Into<ConditionValue>) -> Self
pub fn order_by_desc(self, field: impl Into<String>) -> Self
pub fn order_by_asc(self, field: impl Into<String>) -> Self
pub fn limit(self, value: impl Into<ConditionValue>) -> Self
pub fn offset(self, value: impl Into<ConditionValue>) -> Self
pub fn page(self, page: i64, page_size: i64) -> Self
pub fn group_by(self, field: impl Into<String>) -> Self
pub fn join( self, option: JoinOption, table: impl Into<String>, on_expr: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn where_clause(self, wc: WhereClauseRef) -> Self
pub fn build(self) -> Vec<Condition>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chain
impl !RefUnwindSafe for Chain
impl !Send for Chain
impl !Sync for Chain
impl Unpin for Chain
impl !UnwindSafe for Chain
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