pub enum TsBinaryOp {
NullishCoalescing,
Or,
And,
StrictEq,
StrictNotEq,
GreaterThan,
InstanceOf,
LessThan,
Add,
In,
GreaterThanEq,
LessThanEq,
}Expand description
?? (events_fanout.rs’s env ?? {}), plus three more real operators
#1321 (workers.rs) grounds: ||/&& (the Bearer-header presence
checks, __authz === null || !__authz.startsWith(...) /
__authz !== null && __authz.startsWith(...)) and ===/!==
(pervasive throughout the file’s own tagged-result and header checks).
#1323 (workers_entry.rs) grounds one more: > (the request-body-
ceiling guard’s own Number(__contentLength) > <cap> — the one real
site anywhere in bynk-emit that needs a relational, not equality,
comparison). Not the
full JS/TS operator table (Decision B’s own “extend narrowly” posture) —
see the printer’s own binary_precedence (bynk-ts/src/printer.rs,
private) for why a nested Binary operand’s parenthesisation needed to
become precedence-aware once more than one operator existed. Arc C, step
(11) (#1388) grounds one more: + (string concatenation) — the
ICU-formatting cluster’s own dominant structural pattern, every
literal/placeholder segment in a message template joins this way. Real
JS/TS precedence (binds tighter than every comparison/logical operator
this table already has) and real left-associativity ("a" + "b" + "c"
needs no parens, the same way a same-operator ||/&& chain already
prints flat) both matter here, not just the operator symbol itself.
Variants§
NullishCoalescing
Or
And
StrictEq
StrictNotEq
GreaterThan
InstanceOf
instanceof — Arc C slice 34 (tests_emit.rs slice D, #1403)’s own
real gap: emit_test_case_function’s own catch clause
(e instanceof ExpectationError) is the first real instanceof
anywhere in bynk-emit’s own content. Real JS/TS precedence puts it
at the same tier as the relational comparisons (</>) — sharing
TsBinaryOp::LessThan’s own tier, not a new one — rendered as the
keyword " instanceof ", textually the same shape as &&/||
rather than symbol punctuation.
LessThan
< — Arc C slice 33 (tests_emit.rs slice C, #1401)’s own real gap:
emit_stub_class’s ReturnsEach sequence-cursor guard
(this.__seq_N < <bound>) is the first real < comparison anywhere
in bynk-emit’s own content. Same precedence tier as
TsBinaryOp::GreaterThan (real JS/TS relational operators all
share one level) — added alongside it rather than folding into a
single “relational” variant, matching this enum’s own existing
one-variant-per-real-operator convention.
Add
In
in — Arc E slice 5 (serialisation.rs, #1443)’s own real gap:
emit_record_codec’s per-field default-value prevalidation line
("<field>" in obj ? obj["<field>"] : <default>) needs a real “is
this wire key present at all” test, distinct from !== undefined
(Events slice 3a, #972’s own Decision D: a wire key present with an
explicit null/{"kind":"None"} value must NOT fall through to the
default, only a genuinely absent key may). Real JS/TS grammar puts
in at the exact same RelationalExpression precedence tier as
</>/instanceof (all five — plus <=/>=, unmodelled here —
share one level in the spec), so it joins TsBinaryOp::LessThan’s
tier rather than a new one, the same “share, don’t multiply, tiers”
convention InstanceOf/LessThan already set. Rendered as the
keyword " in ", the same textual-keyword-operator shape
InstanceOf already established (not symbol punctuation).
GreaterThanEq
>= — #1471’s own real gap: pred_condition_and_message’s
(bynk-emit) NonNegative/InRange/InRangeF/MinLength arms
each build a real “at least” comparison ({receiver} >= 0,
{receiver} >= {a}, {receiver}.length >= {n}) that this enum had
no home for — TsBinaryOp::In’s own doc already named this exact
gap (“plus <=/>=, unmodelled here”). Same RelationalExpression
precedence tier as TsBinaryOp::GreaterThan/[TsBinaryOp:: LessThan]/TsBinaryOp::InstanceOf/TsBinaryOp::In (real
JS/TS puts all six at one level), rendered " >= " — symbol
punctuation, matching GreaterThan/LessThan’s own convention,
not a keyword like InstanceOf/In.
LessThanEq
<= — the same gap’s other half: InRange/InRangeF/MaxLength’s
own “at most” comparison ({receiver} <= {b}, {receiver}.length <= {n}). Same tier and rendering convention as
TsBinaryOp::GreaterThanEq, symmetric with it the way
GreaterThan/LessThan already are.
Trait Implementations§
Source§impl Clone for TsBinaryOp
impl Clone for TsBinaryOp
Source§fn clone(&self) -> TsBinaryOp
fn clone(&self) -> TsBinaryOp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TsBinaryOp
impl Debug for TsBinaryOp
Source§impl PartialEq for TsBinaryOp
impl PartialEq for TsBinaryOp
impl Copy for TsBinaryOp
impl Eq for TsBinaryOp
impl StructuralPartialEq for TsBinaryOp
Auto Trait Implementations§
impl Freeze for TsBinaryOp
impl RefUnwindSafe for TsBinaryOp
impl Send for TsBinaryOp
impl Sync for TsBinaryOp
impl Unpin for TsBinaryOp
impl UnsafeUnpin for TsBinaryOp
impl UnwindSafe for TsBinaryOp
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§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();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§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();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§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();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§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();§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.§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);