pub enum ExprNode<'a> {
Show 20 variants
Expr(Cow<'a, Expr>),
SqlExpr(Cow<'a, str>),
Identifier(Cow<'a, str>),
Numeric(NumericNode<'a>),
QuotedString(Cow<'a, str>),
TypedString {
data_type: DataType,
value: Cow<'a, str>,
},
Between {
expr: Box<ExprNode<'a>>,
negated: bool,
low: Box<ExprNode<'a>>,
high: Box<ExprNode<'a>>,
},
Like {
expr: Box<ExprNode<'a>>,
negated: bool,
pattern: Box<ExprNode<'a>>,
},
ILike {
expr: Box<ExprNode<'a>>,
negated: bool,
pattern: Box<ExprNode<'a>>,
},
BinaryOp {
left: Box<ExprNode<'a>>,
op: BinaryOperator,
right: Box<ExprNode<'a>>,
},
UnaryOp {
op: UnaryOperator,
expr: Box<ExprNode<'a>>,
},
IsNull(Box<ExprNode<'a>>),
IsNotNull(Box<ExprNode<'a>>),
InList {
expr: Box<ExprNode<'a>>,
list: Box<InListNode<'a>>,
negated: bool,
},
Nested(Box<ExprNode<'a>>),
Function(Box<FunctionNode<'a>>),
Aggregate(Box<AggregateNode<'a>>),
Exists {
subquery: Box<QueryNode<'a>>,
negated: bool,
},
Subquery(Box<QueryNode<'a>>),
Case {
operand: Option<Box<ExprNode<'a>>>,
when_then: Vec<(ExprNode<'a>, ExprNode<'a>)>,
else_result: Option<Box<ExprNode<'a>>>,
},
}
Variants§
Expr(Cow<'a, Expr>)
SqlExpr(Cow<'a, str>)
Identifier(Cow<'a, str>)
Numeric(NumericNode<'a>)
QuotedString(Cow<'a, str>)
TypedString
Between
Like
ILike
BinaryOp
UnaryOp
IsNull(Box<ExprNode<'a>>)
IsNotNull(Box<ExprNode<'a>>)
InList
Nested(Box<ExprNode<'a>>)
Function(Box<FunctionNode<'a>>)
Aggregate(Box<AggregateNode<'a>>)
Exists
Subquery(Box<QueryNode<'a>>)
Case
Implementations§
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
pub fn add<T>(self, other: T) -> ExprNode<'a>
pub fn sub<T>(self, other: T) -> ExprNode<'a>
pub fn mul<T>(self, other: T) -> ExprNode<'a>
pub fn div<T>(self, other: T) -> ExprNode<'a>
pub fn modulo<T>(self, other: T) -> ExprNode<'a>
pub fn concat<T>(self, other: T) -> ExprNode<'a>
pub fn gt<T>(self, other: T) -> ExprNode<'a>
pub fn lt<T>(self, other: T) -> ExprNode<'a>
pub fn gte<T>(self, other: T) -> ExprNode<'a>
pub fn lte<T>(self, other: T) -> ExprNode<'a>
pub fn eq<T>(self, other: T) -> ExprNode<'a>
pub fn neq<T>(self, other: T) -> ExprNode<'a>
pub fn and<T>(self, other: T) -> ExprNode<'a>
pub fn or<T>(self, other: T) -> ExprNode<'a>
pub fn bitwise_and<T>(self, other: T) -> ExprNode<'a>
pub fn bitwise_shift_left<T>(self, other: T) -> ExprNode<'a>
pub fn bitwise_shift_right<T>(self, other: T) -> ExprNode<'a>
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
pub fn abs(self) -> ExprNode<'a>
pub fn upper(self) -> ExprNode<'a>
pub fn lower(self) -> ExprNode<'a>
pub fn initcap(self) -> ExprNode<'a>
pub fn ifnull<T>(self, another: T) -> ExprNode<'a>
pub fn ceil(self) -> ExprNode<'a>
pub fn rand(self) -> ExprNode<'a>
pub fn round(self) -> ExprNode<'a>
pub fn floor(self) -> ExprNode<'a>
pub fn asin(self) -> ExprNode<'a>
pub fn acos(self) -> ExprNode<'a>
pub fn atan(self) -> ExprNode<'a>
pub fn sin(self) -> ExprNode<'a>
pub fn cos(self) -> ExprNode<'a>
pub fn tan(self) -> ExprNode<'a>
pub fn left<T>(self, size: T) -> ExprNode<'a>
pub fn log<T>(self, base: T) -> ExprNode<'a>
pub fn log2(self) -> ExprNode<'a>
pub fn log10(self) -> ExprNode<'a>
pub fn ln(self) -> ExprNode<'a>
pub fn right<T>(self, size: T) -> ExprNode<'a>
pub fn reverse(self) -> ExprNode<'a>
pub fn sign(self) -> ExprNode<'a>
pub fn skip<T>(self, size: T) -> ExprNode<'a>
pub fn power<T>(self, pwr: T) -> ExprNode<'a>
pub fn sqrt(self) -> ExprNode<'a>
pub fn gcd<T>(self, right: T) -> ExprNode<'a>
pub fn lcm<T>(self, right: T) -> ExprNode<'a>
pub fn repeat<T>(self, num: T) -> ExprNode<'a>
pub fn replace<T, U>(self, old: T, new: U) -> ExprNode<'a>
pub fn degrees(self) -> ExprNode<'a>
pub fn radians(self) -> ExprNode<'a>
pub fn lpad<T>(self, size: T, fill: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn rpad<T>(self, size: T, fill: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn take<T>(self, size: T) -> ExprNode<'a>
pub fn exp(self) -> ExprNode<'a>
pub fn substr<T>(self, start: T, count: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn rtrim(self, chars: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn ltrim(self, chars: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn format<T>(self, fmt: T) -> ExprNode<'a>
pub fn to_date<T>(self, format: T) -> ExprNode<'a>
pub fn to_timestamp<T>(self, format: T) -> ExprNode<'a>
pub fn to_time<T>(self, format: T) -> ExprNode<'a>
pub fn position<T>(self, format: T) -> ExprNode<'a>
pub fn find_idx<T>(self, sub: T, start: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn cast<T>(self, data_type: T) -> ExprNode<'a>where
T: Into<DataTypeNode>,
pub fn extract(self, field: DateTimeField) -> ExprNode<'a>
pub fn is_empty(self) -> ExprNode<'a>
pub fn last_day(self) -> ExprNode<'a>
pub fn entries(self) -> ExprNode<'a>
pub fn keys(self) -> ExprNode<'a>
pub fn values(self) -> ExprNode<'a>
Trait Implementations§
Source§impl<'a> From<ExprNode<'a>> for OrderByExprList<'a>
impl<'a> From<ExprNode<'a>> for OrderByExprList<'a>
Source§fn from(expr_node: ExprNode<'a>) -> OrderByExprList<'a>
fn from(expr_node: ExprNode<'a>) -> OrderByExprList<'a>
Source§impl<'a> From<ExprNode<'a>> for OrderByExprNode<'a>
impl<'a> From<ExprNode<'a>> for OrderByExprNode<'a>
Source§fn from(expr_node: ExprNode<'a>) -> OrderByExprNode<'a>
fn from(expr_node: ExprNode<'a>) -> OrderByExprNode<'a>
Source§impl<'a> From<ExprNode<'a>> for SelectItemList<'a>
impl<'a> From<ExprNode<'a>> for SelectItemList<'a>
Source§fn from(expr_node: ExprNode<'a>) -> SelectItemList<'a>
fn from(expr_node: ExprNode<'a>) -> SelectItemList<'a>
Source§impl<'a> From<ExprNode<'a>> for SelectItemNode<'a>
impl<'a> From<ExprNode<'a>> for SelectItemNode<'a>
Source§fn from(expr_node: ExprNode<'a>) -> SelectItemNode<'a>
fn from(expr_node: ExprNode<'a>) -> SelectItemNode<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExprNode<'a>
impl<'a> RefUnwindSafe for ExprNode<'a>
impl<'a> Send for ExprNode<'a>
impl<'a> Sync for ExprNode<'a>
impl<'a> Unpin for ExprNode<'a>
impl<'a> UnwindSafe for ExprNode<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.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>
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>
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<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.