pub enum HirRelationExpr {
Show 15 variants
Constant {
rows: Vec<Row>,
typ: SqlRelationType,
},
Get {
id: Id,
typ: SqlRelationType,
},
LetRec {
limit: Option<LetRecLimit>,
bindings: Vec<(String, LocalId, HirRelationExpr, SqlRelationType)>,
body: Box<HirRelationExpr>,
},
Let {
name: String,
id: LocalId,
value: Box<HirRelationExpr>,
body: Box<HirRelationExpr>,
},
Project {
input: Box<HirRelationExpr>,
outputs: Vec<usize>,
},
Map {
input: Box<HirRelationExpr>,
scalars: Vec<HirScalarExpr>,
},
CallTable {
func: TableFunc,
exprs: Vec<HirScalarExpr>,
},
Filter {
input: Box<HirRelationExpr>,
predicates: Vec<HirScalarExpr>,
},
Join {
left: Box<HirRelationExpr>,
right: Box<HirRelationExpr>,
on: HirScalarExpr,
kind: JoinKind,
},
Reduce {
input: Box<HirRelationExpr>,
group_key: Vec<usize>,
aggregates: Vec<AggregateExpr>,
expected_group_size: Option<u64>,
},
Distinct {
input: Box<HirRelationExpr>,
},
TopK {
input: Box<HirRelationExpr>,
group_key: Vec<usize>,
order_key: Vec<ColumnOrder>,
limit: Option<HirScalarExpr>,
offset: HirScalarExpr,
expected_group_size: Option<u64>,
},
Negate {
input: Box<HirRelationExpr>,
},
Threshold {
input: Box<HirRelationExpr>,
},
Union {
base: Box<HirRelationExpr>,
inputs: Vec<HirRelationExpr>,
},
}Expand description
Just like mz_expr::MirRelationExpr, except where otherwise noted below.
Variants§
Constant
Get
LetRec
Mutually recursive CTE
Fields
limit: Option<LetRecLimit>Maximum number of iterations to evaluate. If None, then there is no limit.
bindings: Vec<(String, LocalId, HirRelationExpr, SqlRelationType)>List of bindings all of which are in scope of each other.
body: Box<HirRelationExpr>Result of the AST node.
Let
CTE
Fields
value: Box<HirRelationExpr>The collection to be bound to name.
body: Box<HirRelationExpr>The result of the Let, evaluated with name bound to value.
Project
Map
CallTable
Filter
Join
Unlike MirRelationExpr, we haven’t yet compiled LeftOuter/RightOuter/FullOuter joins away into more primitive exprs
Reduce
Unlike MirRelationExpr, when key is empty AND input is empty this returns
a single row with the aggregates evaluated over empty groups, rather than returning zero
rows
Distinct
Fields
input: Box<HirRelationExpr>TopK
Groups and orders within each group, limiting output.
Fields
input: Box<HirRelationExpr>The source collection.
order_key: Vec<ColumnOrder>Column indices used to order rows within groups.
limit: Option<HirScalarExpr>Number of records to retain.
It is of SqlScalarType::Int64.
(UInt64 would make sense in theory: Then we wouldn’t need to manually check
non-negativity, but would just get this for free when casting to UInt64. However, Int64
is better for Postgres compat. This is because if there is a $1 here, then when external
tools describe the prepared statement, they discover this type. If what they find
were UInt64, then they might have trouble calling the prepared statement, because the
unsigned types are non-standard, and also don’t exist even in Postgres.)
offset: HirScalarExprNumber of records to skip. It is of SqlScalarType::Int64. This can contain parameters at first, but by the time we reach lowering, this should already be simply a Literal.
Negate
Fields
input: Box<HirRelationExpr>Threshold
Keep rows from a dataflow where the row counts are positive.
Fields
input: Box<HirRelationExpr>Union
Implementations§
Source§impl HirRelationExpr
impl HirRelationExpr
fn fmt_virtual_syntax( &self, f: &mut Formatter<'_>, ctx: &mut PlanRenderingContext<'_, HirRelationExpr>, ) -> Result
fn fmt_raw_syntax( &self, f: &mut Formatter<'_>, ctx: &mut PlanRenderingContext<'_, HirRelationExpr>, ) -> Result
Source§impl<'a> HirRelationExpr
impl<'a> HirRelationExpr
fn as_explain_single_plan( &'a mut self, context: &'a ExplainContext<'a>, ) -> Result<ExplainSinglePlan<'a, HirRelationExpr>, ExplainError>
Source§impl HirRelationExpr
impl HirRelationExpr
pub fn typ( &self, outers: &[SqlRelationType], params: &BTreeMap<usize, SqlScalarType>, ) -> SqlRelationType
pub fn arity(&self) -> usize
Sourcepub fn as_const(&self) -> Option<(&Vec<Row>, &SqlRelationType)>
pub fn as_const(&self) -> Option<(&Vec<Row>, &SqlRelationType)>
If self is a constant, return the value and the type, otherwise None.
Reports whether this expression contains a column reference to its direct parent scope.
pub fn is_join_identity(&self) -> bool
pub fn project(self, outputs: Vec<usize>) -> Self
pub fn map(self, scalars: Vec<HirScalarExpr>) -> Self
pub fn filter(self, preds: Vec<HirScalarExpr>) -> Self
pub fn reduce( self, group_key: Vec<usize>, aggregates: Vec<AggregateExpr>, expected_group_size: Option<u64>, ) -> Self
pub fn top_k( self, group_key: Vec<usize>, order_key: Vec<ColumnOrder>, limit: Option<HirScalarExpr>, offset: HirScalarExpr, expected_group_size: Option<u64>, ) -> Self
pub fn negate(self) -> Self
pub fn distinct(self) -> Self
pub fn threshold(self) -> Self
pub fn union(self, other: Self) -> Self
pub fn exists(self) -> HirScalarExpr
pub fn select(self) -> HirScalarExpr
pub fn join( self, right: HirRelationExpr, on: HirScalarExpr, kind: JoinKind, ) -> HirRelationExpr
pub fn take(&mut self) -> HirRelationExpr
pub fn visit<'a, F>(&'a self, depth: usize, f: &mut F)
Visit::visit_post.pub fn visit_fallible<'a, F, E>( &'a self, depth: usize, f: &mut F, ) -> Result<(), E>
Visit::try_visit_post.pub fn visit1<'a, F, E>(&'a self, depth: usize, f: F) -> Result<(), E>
VisitChildren<HirRelationExpr>::try_visit_children instead.pub fn visit_mut<F>(&mut self, depth: usize, f: &mut F)
Visit::visit_mut_post instead.pub fn visit_mut_fallible<F, E>( &mut self, depth: usize, f: &mut F, ) -> Result<(), E>
Visit::try_visit_mut_post instead.pub fn visit1_mut<'a, F, E>(&'a mut self, depth: usize, f: F) -> Result<(), E>
VisitChildren<HirRelationExpr>::try_visit_mut_children instead.Sourcepub fn visit_scalar_expressions<F, E>(
&self,
depth: usize,
f: &mut F,
) -> Result<(), E>
👎Deprecated: Use a combination of Visit and VisitChildren methods.
pub fn visit_scalar_expressions<F, E>( &self, depth: usize, f: &mut F, ) -> Result<(), E>
Visit and VisitChildren methods.Visits all scalar expressions within the sub-tree of the given relation.
The depth argument should indicate the subquery nesting depth of the expression,
which will be incremented when entering the RHS of a join or a subquery and
presented to the supplied function f.
Sourcepub fn visit_scalar_expressions_mut<F, E>(
&mut self,
depth: usize,
f: &mut F,
) -> Result<(), E>
👎Deprecated: Use a combination of Visit and VisitChildren methods.
pub fn visit_scalar_expressions_mut<F, E>( &mut self, depth: usize, f: &mut F, ) -> Result<(), E>
Visit and VisitChildren methods.Like visit_scalar_expressions, but permits mutating the expressions.
Sourcepub fn visit_columns<F>(&self, depth: usize, f: &mut F)
👎Deprecated: Redefine this based on the Visit and VisitChildren methods.
pub fn visit_columns<F>(&self, depth: usize, f: &mut F)
Visit and VisitChildren methods.Visits the column references in this relation expression.
The depth argument should indicate the subquery nesting depth of the expression,
which will be incremented when entering the RHS of a join or a subquery and
presented to the supplied function f.
Sourcepub fn visit_columns_mut<F>(&mut self, depth: usize, f: &mut F)
👎Deprecated: Redefine this based on the Visit and VisitChildren methods.
pub fn visit_columns_mut<F>(&mut self, depth: usize, f: &mut F)
Visit and VisitChildren methods.Like visit_columns, but permits mutating the column references.
Sourcepub fn bind_parameters(
&mut self,
scx: &StatementContext<'_>,
lifetime: QueryLifetime,
params: &Params,
) -> Result<(), PlanError>
pub fn bind_parameters( &mut self, scx: &StatementContext<'_>, lifetime: QueryLifetime, params: &Params, ) -> Result<(), PlanError>
Replaces any parameter references in the expression with the
corresponding datum from params.
pub fn contains_parameters(&self) -> Result<bool, PlanError>
Sourcepub fn splice_parameters(&mut self, params: &[HirScalarExpr], depth: usize)
pub fn splice_parameters(&mut self, params: &[HirScalarExpr], depth: usize)
See the documentation for HirScalarExpr::splice_parameters.
Sourcepub fn constant(rows: Vec<Vec<Datum<'_>>>, typ: SqlRelationType) -> Self
pub fn constant(rows: Vec<Vec<Datum<'_>>>, typ: SqlRelationType) -> Self
Constructs a constant collection from specific rows and schema.
Sourcepub fn finish_maintained(
&mut self,
finishing: &mut RowSetFinishing<HirScalarExpr, HirScalarExpr>,
group_size_hints: GroupSizeHints,
)
pub fn finish_maintained( &mut self, finishing: &mut RowSetFinishing<HirScalarExpr, HirScalarExpr>, group_size_hints: GroupSizeHints, )
A RowSetFinishing can only be directly applied to the result of a one-shot select.
This function is concerned with maintained queries, e.g., an index or materialized view.
Instead of directly applying the given RowSetFinishing, it converts the RowSetFinishing
to a TopK, which it then places at the top of self. Additionally, it turns the given
finishing into a trivial finishing.
Sourcepub fn trivial_row_set_finishing_hir(
arity: usize,
) -> RowSetFinishing<HirScalarExpr, HirScalarExpr>
pub fn trivial_row_set_finishing_hir( arity: usize, ) -> RowSetFinishing<HirScalarExpr, HirScalarExpr>
Returns a trivial finishing, i.e., that does nothing to the result set.
(There is also RowSetFinishing::trivial, but that is specialized for when the O generic
parameter is not an HirScalarExpr anymore.)
Sourcepub fn is_trivial_row_set_finishing_hir(
rsf: &RowSetFinishing<HirScalarExpr, HirScalarExpr>,
arity: usize,
) -> bool
pub fn is_trivial_row_set_finishing_hir( rsf: &RowSetFinishing<HirScalarExpr, HirScalarExpr>, arity: usize, ) -> bool
True if the finishing does nothing to any result set.
(There is also RowSetFinishing::is_trivial, but that is specialized for when the O generic
parameter is not an HirScalarExpr anymore.)
Sourcepub fn could_run_expensive_function(&self) -> bool
pub fn could_run_expensive_function(&self) -> bool
The HirRelationExpr is considered potentially expensive if and only if at least one of the following conditions is true:
- It contains at least one CallTable or a Reduce operator.
- It contains at least one HirScalarExpr with a function call.
!!!WARNING!!!: this method has an MirRelationExpr counterpart. The two should be kept in sync w.r.t. HIR ⇒ MIR lowering!
Sourcepub fn contains_temporal(&self) -> Result<bool, RecursionLimitError>
pub fn contains_temporal(&self) -> Result<bool, RecursionLimitError>
Whether the expression contains an UnmaterializableFunc::MzNow call.
Sourcepub fn contains_unmaterializable(&self) -> Result<bool, RecursionLimitError>
pub fn contains_unmaterializable(&self) -> Result<bool, RecursionLimitError>
Whether the expression contains any UnmaterializableFunc call.
Source§impl HirRelationExpr
impl HirRelationExpr
Sourcepub fn lower<C: Into<Config>>(
self,
config: C,
metrics: Option<&OptimizerMetrics>,
) -> Result<MirRelationExpr, PlanError>
pub fn lower<C: Into<Config>>( self, config: C, metrics: Option<&OptimizerMetrics>, ) -> Result<MirRelationExpr, PlanError>
Rewrite self into a MirRelationExpr.
This requires rewriting all correlated subqueries (nested HirRelationExprs) into flat queries
Sourcefn applied_to(
self,
id_gen: &mut IdGen,
get_outer: MirRelationExpr,
col_map: &ColumnMap,
cte_map: &mut BTreeMap<LocalId, CteDesc>,
context: &Context<'_>,
) -> Result<MirRelationExpr, PlanError>
fn applied_to( self, id_gen: &mut IdGen, get_outer: MirRelationExpr, col_map: &ColumnMap, cte_map: &mut BTreeMap<LocalId, CteDesc>, context: &Context<'_>, ) -> Result<MirRelationExpr, PlanError>
Return a MirRelationExpr which evaluates self once for each row of get_outer.
For uncorrelated self, this should be the cross-product between get_outer and self.
When self references columns of get_outer, much more work needs to occur.
The col_map argument contains mappings to some of the columns of get_outer, though
perhaps not all of them. It should be used as the basis of resolving column references,
but care must be taken when adding new columns that get_outer.arity() is where they
will start, rather than any function of col_map.
The get_outer expression should be a Get with no duplicate rows, describing the distinct
assignment of values to outer rows.
Trait Implementations§
Source§impl Clone for HirRelationExpr
impl Clone for HirRelationExpr
Source§fn clone(&self) -> HirRelationExpr
fn clone(&self) -> HirRelationExpr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CollectionPlan for HirRelationExpr
impl CollectionPlan for HirRelationExpr
Source§impl Debug for HirRelationExpr
impl Debug for HirRelationExpr
Source§impl<'de> Deserialize<'de> for HirRelationExpr
impl<'de> Deserialize<'de> for HirRelationExpr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl DisplayText<PlanRenderingContext<'_, HirRelationExpr>> for HirRelationExpr
impl DisplayText<PlanRenderingContext<'_, HirRelationExpr>> for HirRelationExpr
fn fmt_text( &self, f: &mut Formatter<'_>, ctx: &mut PlanRenderingContext<'_, HirRelationExpr>, ) -> Result
Source§impl<'a> Explain<'a> for HirRelationExpr
impl<'a> Explain<'a> for HirRelationExpr
Source§type Context = ExplainContext<'a>
type Context = ExplainContext<'a>
Source§type Text = ExplainSinglePlan<'a, HirRelationExpr>
type Text = ExplainSinglePlan<'a, HirRelationExpr>
Explain::explain_text call.Source§type Json = ExplainSinglePlan<'a, HirRelationExpr>
type Json = ExplainSinglePlan<'a, HirRelationExpr>
Explain::explain_json call.Source§type Dot = UnsupportedFormat
type Dot = UnsupportedFormat
Explain::explain_json call.Source§fn explain_text(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::Text, ExplainError>
fn explain_text( &'a mut self, context: &'a Self::Context, ) -> Result<Self::Text, ExplainError>
Source§fn explain_json(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::Json, ExplainError>
fn explain_json( &'a mut self, context: &'a Self::Context, ) -> Result<Self::Json, ExplainError>
Source§fn explain(
&'a mut self,
format: &'a ExplainFormat,
context: &'a Self::Context,
) -> Result<String, ExplainError>
fn explain( &'a mut self, format: &'a ExplainFormat, context: &'a Self::Context, ) -> Result<String, ExplainError>
Source§fn explain_dot(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::Dot, ExplainError>
fn explain_dot( &'a mut self, context: &'a Self::Context, ) -> Result<Self::Dot, ExplainError>
Source§impl Hash for HirRelationExpr
impl Hash for HirRelationExpr
Source§impl Ord for HirRelationExpr
impl Ord for HirRelationExpr
Source§fn cmp(&self, other: &HirRelationExpr) -> Ordering
fn cmp(&self, other: &HirRelationExpr) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HirRelationExpr
impl PartialEq for HirRelationExpr
Source§impl PartialOrd for HirRelationExpr
impl PartialOrd for HirRelationExpr
Source§impl Serialize for HirRelationExpr
impl Serialize for HirRelationExpr
Source§impl VisitChildren<HirRelationExpr> for HirRelationExpr
impl VisitChildren<HirRelationExpr> for HirRelationExpr
Source§fn visit_children<F>(&self, f: F)where
F: FnMut(&Self),
fn visit_children<F>(&self, f: F)where
F: FnMut(&Self),
f to each direct child.Source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut Self),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut Self),
f to each direct child.Source§impl VisitChildren<HirScalarExpr> for HirRelationExpr
impl VisitChildren<HirScalarExpr> for HirRelationExpr
Source§fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
fn visit_children<F>(&self, f: F)where
F: FnMut(&HirScalarExpr),
f to each direct child.Source§fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
fn visit_mut_children<F>(&mut self, f: F)where
F: FnMut(&mut HirScalarExpr),
f to each direct child.Source§fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
fn try_visit_children<F, E>(&self, f: F) -> Result<(), E>
f to each direct child. Read moreimpl Eq for HirRelationExpr
impl StructuralPartialEq for HirRelationExpr
Auto Trait Implementations§
impl Freeze for HirRelationExpr
impl RefUnwindSafe for HirRelationExpr
impl Send for HirRelationExpr
impl Sync for HirRelationExpr
impl Unpin for HirRelationExpr
impl UnwindSafe for HirRelationExpr
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
Source§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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
Source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto.Source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto.Source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign, for types that do not implement AddAssign.Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
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.Source§impl<T> Visit for Twhere
T: VisitChildren<T>,
impl<T> Visit for Twhere
T: VisitChildren<T>,
Source§fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
self.Source§fn visit_post_nolimit<F>(&self, f: &mut F)
fn visit_post_nolimit<F>(&self, f: &mut F)
visit_post instead.self.
Does not enforce a recursion limit.Source§fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
self.Source§fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)
fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)
visit_mut_post instead.self.
Does not enforce a recursion limit.Source§fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>
fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>
self.Source§fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>
fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>
self.Source§fn visit_pre<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_pre<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
self.Source§fn visit_pre_with_context<Context, AccFun, Visitor>(
&self,
init: Context,
acc_fun: &mut AccFun,
visitor: &mut Visitor,
) -> Result<(), RecursionLimitError>
fn visit_pre_with_context<Context, AccFun, Visitor>( &self, init: Context, acc_fun: &mut AccFun, visitor: &mut Visitor, ) -> Result<(), RecursionLimitError>
self, which also accumulates context
information along the path from the root to the current node’s parent.
acc_fun is a similar closure as in fold. The accumulated context is passed to the
visitor, along with the current node. Read moreSource§fn visit_pre_nolimit<F>(&self, f: &mut F)
fn visit_pre_nolimit<F>(&self, f: &mut F)
visit_pre instead.self.
Does not enforce a recursion limit.Source§fn visit_mut_pre<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
fn visit_mut_pre<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
self.Source§fn visit_mut_pre_nolimit<F>(&mut self, f: &mut F)
fn visit_mut_pre_nolimit<F>(&mut self, f: &mut F)
visit_mut_pre instead.self.
Does not enforce a recursion limit.Source§fn try_visit_pre<F, E>(&self, f: &mut F) -> Result<(), E>
fn try_visit_pre<F, E>(&self, f: &mut F) -> Result<(), E>
self.Source§fn try_visit_mut_pre<F, E>(&mut self, f: &mut F) -> Result<(), E>
fn try_visit_mut_pre<F, E>(&mut self, f: &mut F) -> Result<(), E>
self.Source§fn visit_pre_post<F1, F2>(
&self,
pre: &mut F1,
post: &mut F2,
) -> Result<(), RecursionLimitError>
fn visit_pre_post<F1, F2>( &self, pre: &mut F1, post: &mut F2, ) -> Result<(), RecursionLimitError>
Source§fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)
fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)
visit instead.Visit::visit_pre and Visit::visit_post.
Does not enforce a recursion limit. Read moreSource§fn visit_mut_pre_post<F1, F2>(
&mut self,
pre: &mut F1,
post: &mut F2,
) -> Result<(), RecursionLimitError>
fn visit_mut_pre_post<F1, F2>( &mut self, pre: &mut F1, post: &mut F2, ) -> Result<(), RecursionLimitError>
visit_mut instead.Source§fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)
fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)
visit_mut_pre_post instead.Visit::visit_mut_pre and Visit::visit_mut_post.
Does not enforce a recursion limit. Read more