pub struct Expression<T> {
pub template: String,
pub parameters: Vec<ExpressiveEnum<T>>,
}Expand description
Owned expression contains template and Vec of IntoExpressive parameters
Fields§
§template: String§parameters: Vec<ExpressiveEnum<T>>Implementations§
Source§impl<T> Expression<T>
impl<T> Expression<T>
Sourcepub fn new(
template: impl Into<String>,
parameters: Vec<ExpressiveEnum<T>>,
) -> Expression<T>
pub fn new( template: impl Into<String>, parameters: Vec<ExpressiveEnum<T>>, ) -> Expression<T>
Create a new owned expression with template and parameters
Sourcepub fn empty() -> Expression<T>
pub fn empty() -> Expression<T>
Create an empty expression that renders as “”.
Sourcepub fn from_vec(vec: Vec<Expression<T>>, delimiter: &str) -> Expression<T>
pub fn from_vec(vec: Vec<Expression<T>>, delimiter: &str) -> Expression<T>
Create expression from vector of expressions and a delimiter
See the module-level documentation for examples.
Source§impl<T> Expression<T>
impl<T> Expression<T>
Sourcepub fn as_type<U>(self) -> Expression<U>
pub fn as_type<U>(self) -> Expression<U>
Explicitly convert this expression to a different type.
Maps all scalar parameters via Into<U>. Useful for crossing type
boundaries — e.g. converting Expression<i64> from a typed column
operation into Expression<AnySqliteType> so it can be chained
with operations on other types.
ⓘ
let price = Column::<i64>::new("price");
price.gt(10) // Expression<i64>
.as_type::<AnySqliteType>() // Expression<AnySqliteType>
.eq(false) // now bool is acceptedTrait Implementations§
Source§impl<T> Add for Expression<T>
impl<T> Add for Expression<T>
Source§type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the
+ operator.Source§fn add(self, rhs: Expression<T>) -> <Expression<T> as Add>::Output
fn add(self, rhs: Expression<T>) -> <Expression<T> as Add>::Output
Performs the
+ operation. Read moreSource§impl<T> Clone for Expression<T>where
T: Clone,
impl<T> Clone for Expression<T>where
T: Clone,
Source§fn clone(&self) -> Expression<T>
fn clone(&self) -> Expression<T>
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<T> Debug for Expression<T>
impl<T> Debug for Expression<T>
Source§impl<T> Div for Expression<T>
impl<T> Div for Expression<T>
Source§type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the
/ operator.Source§fn div(self, rhs: Expression<T>) -> <Expression<T> as Div>::Output
fn div(self, rhs: Expression<T>) -> <Expression<T> as Div>::Output
Performs the
/ operation. Read moreSource§impl<From> ExpressionMap<From> for Expression<From>
impl<From> ExpressionMap<From> for Expression<From>
Source§impl<From, To> ExpressionMapper<From, To> for Expression<From>
impl<From, To> ExpressionMapper<From, To> for Expression<From>
Source§fn map_expression(expr: Expression<From>) -> Expression<To>
fn map_expression(expr: Expression<From>) -> Expression<To>
Convert
Expression<From> to Expression<To>Source§impl<T> Expressive<T> for Expression<T>where
T: Clone,
impl<T> Expressive<T> for Expression<T>where
T: Clone,
Source§impl<F> From<Expression<F>> for SqliteCondition
impl<F> From<Expression<F>> for SqliteCondition
Source§fn from(expr: Expression<F>) -> Self
fn from(expr: Expression<F>) -> Self
Converts to this type from the input type.
Source§impl From<Identifier> for Expression<AnySqliteType>
Available on crate feature sqlite only.
impl From<Identifier> for Expression<AnySqliteType>
Available on crate feature
sqlite only.Source§fn from(id: Identifier) -> Self
fn from(id: Identifier) -> Self
Converts to this type from the input type.
Source§impl From<MockSelect> for Expression<Value>
impl From<MockSelect> for Expression<Value>
Source§fn from(val: MockSelect) -> Expression<Value>
fn from(val: MockSelect) -> Expression<Value>
Converts to this type from the input type.
Source§impl From<SqliteCondition> for Expression<AnySqliteType>
impl From<SqliteCondition> for Expression<AnySqliteType>
Source§fn from(cond: SqliteCondition) -> Self
fn from(cond: SqliteCondition) -> Self
Converts to this type from the input type.
Source§impl From<SqliteDelete> for Expression<AnySqliteType>
impl From<SqliteDelete> for Expression<AnySqliteType>
Source§fn from(delete: SqliteDelete) -> Self
fn from(delete: SqliteDelete) -> Self
Converts to this type from the input type.
Source§impl From<SqliteIdent> for Expression<AnySqliteType>
impl From<SqliteIdent> for Expression<AnySqliteType>
Source§fn from(id: SqliteIdent) -> Self
fn from(id: SqliteIdent) -> Self
Converts to this type from the input type.
Source§impl From<SqliteInsert> for Expression<AnySqliteType>
impl From<SqliteInsert> for Expression<AnySqliteType>
Source§fn from(insert: SqliteInsert) -> Self
fn from(insert: SqliteInsert) -> Self
Converts to this type from the input type.
Source§impl From<SqliteUpdate> for Expression<AnySqliteType>
impl From<SqliteUpdate> for Expression<AnySqliteType>
Source§fn from(update: SqliteUpdate) -> Self
fn from(update: SqliteUpdate) -> Self
Converts to this type from the input type.
Source§impl<T> Mul for Expression<T>
impl<T> Mul for Expression<T>
Source§type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: Expression<T>) -> <Expression<T> as Mul>::Output
fn mul(self, rhs: Expression<T>) -> <Expression<T> as Mul>::Output
Performs the
* operation. Read moreSource§impl<T> OrderByExt<Expression<T>> for Expression<T>
impl<T> OrderByExt<Expression<T>> for Expression<T>
Source§fn ascending(&self) -> OrderBy<Expression<T>>
fn ascending(&self) -> OrderBy<Expression<T>>
Create an ascending order specification
Source§fn descending(&self) -> OrderBy<Expression<T>>
fn descending(&self) -> OrderBy<Expression<T>>
Create a descending order specification
Source§impl<T> Sub for Expression<T>
impl<T> Sub for Expression<T>
Source§type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the
- operator.Source§fn sub(self, rhs: Expression<T>) -> <Expression<T> as Sub>::Output
fn sub(self, rhs: Expression<T>) -> <Expression<T> as Sub>::Output
Performs the
- operation. Read moreAuto Trait Implementations§
impl<T> Freeze for Expression<T>
impl<T> !RefUnwindSafe for Expression<T>
impl<T> Send for Expression<T>where
T: Send,
impl<T> Sync for Expression<T>where
T: Sync,
impl<T> Unpin for Expression<T>where
T: Unpin,
impl<T> UnsafeUnpin for Expression<T>
impl<T> !UnwindSafe for Expression<T>
Blanket Implementations§
Source§impl<T, E> AliasExt<T> for Ewhere
E: Expressive<T>,
impl<T, E> AliasExt<T> for Ewhere
E: Expressive<T>,
fn as_alias(self, alias: impl Into<String>) -> Expression<T>where
Identifier: Expressive<T>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExpressionLike for T
impl<T> ExpressionLike for T
Source§fn clone_box(&self) -> Box<dyn ExpressionLike>
fn clone_box(&self) -> Box<dyn ExpressionLike>
Clone this expression into a Box
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Set the foreground color generically Read more
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Set the background color generically. Read more
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Change the foreground color to black
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Change the background color to black
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Change the foreground color to red
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Change the background color to red
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Change the foreground color to green
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Change the background color to green
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Change the foreground color to yellow
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Change the background color to yellow
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Change the foreground color to blue
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Change the background color to blue
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Change the foreground color to magenta
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to magenta
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Change the foreground color to purple
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to purple
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Change the foreground color to cyan
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Change the background color to cyan
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Change the foreground color to white
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Change the background color to white
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Change the foreground color to the terminal default
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Change the background color to the terminal default
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Change the foreground color to bright black
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Change the background color to bright black
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Change the foreground color to bright red
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Change the background color to bright red
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Change the foreground color to bright green
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Change the background color to bright green
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Change the foreground color to bright yellow
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Change the background color to bright yellow
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Change the foreground color to bright blue
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Change the background color to bright blue
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright magenta
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright magenta
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright purple
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright purple
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Change the foreground color to bright cyan
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Change the background color to bright cyan
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Change the foreground color to bright white
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Change the background color to bright white
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Make the text bold
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Make the text dim
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Make the text italicized
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Make the text underlined
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Make the text blink
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Make the text blink (but fast!)
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Swap the foreground and background colors
Hide the text
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Cross out the text
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.
Source§impl<T, S> SqliteOperation<T> for S
impl<T, S> SqliteOperation<T> for S
Source§fn eq(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn eq(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field = valueSource§fn ne(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn ne(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field != valueSource§fn gt(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn gt(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field > valueSource§fn gte(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn gte(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field >= valueSource§fn lt(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn lt(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field < valueSource§fn lte(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn lte(&self, value: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field <= valueSource§fn in_(&self, values: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
fn in_(&self, values: impl Expressive<T>) -> SqliteConditionwhere
Self: Sized,
field IN (values_expression)Source§fn in_list<V: Into<T> + Clone>(&self, values: &[V]) -> SqliteCondition
fn in_list<V: Into<T> + Clone>(&self, values: &[V]) -> SqliteCondition
field IN (a, b, c) from a slice of scalar valuesSource§fn is_null(&self) -> SqliteConditionwhere
Self: Sized,
fn is_null(&self) -> SqliteConditionwhere
Self: Sized,
field IS NULLSource§fn is_not_null(&self) -> SqliteConditionwhere
Self: Sized,
fn is_not_null(&self) -> SqliteConditionwhere
Self: Sized,
field IS NOT NULL