pub enum ProviderBody {
Bynk {
given: Vec<CapRefIr>,
ops: Vec<ProviderOpIr>,
},
External {
given: Vec<CapRefIr>,
},
}Expand description
P6.14’s real ProviderBody ([DECISION A], #1174) — referenced by the
reference’s own IrItem::Provider sketch
(bynk-greenfield-compiler.md:1135, body: ProviderBody // Bynk ops | External(module)) but never defined anywhere in the document as a real
Rust type, the same “referenced, not specified” gap Capability’s own
OpSig carried before #1173 settled it. Mirrors ProviderDecl::external
(bynk-syntax/src/ast.rs:592-595) exactly: true (no brace block, an
adapter-supplied binding) becomes External, false (a real Bynk-
authored implementation) becomes Bynk. See IrItem’s own doc
comment for why External carries no module field despite the
reference’s own parenthetical, and why it carries given instead of
omitting that too.
Variants§
Bynk
A real Bynk-authored implementation.
Fields
ops: Vec<ProviderOpIr>Every operation, bynk_lower::lower_provider_op_ir’s own return
value, in declaration order. Not guaranteed non-empty
(review of #1186): external is set purely by brace-block
absence, not emptiness (bynk-syntax/src/parser/declarations.rs:1795-1811),
so provides Cap = P {} also lowers here, with ops: vec![] —
the bynk.provider.missing_operation check that would reject
it is a whole-project pass (bynk-check/src/project_model.rs:2468),
not part of check_provider_decls, so a bare CheckedProgram
(this function’s only input) is certified without it.
External
provides Cap = Name with no brace block — the adapter’s own
binding supplies the implementation; the emitter produces no class
(bynk-greenfield-compiler.md:1310, Provider{External} | nothing).
Carries given too (added #1187’s Provider given/deps-wiring
slice, correcting a real gap this bare-unit shape left): an external
provider’s own given clause is populated the same way Bynk’s is
(ProviderDecl::given is not gated on external anywhere in the
grammar or checker) and instantiate_provider_ts_expr
(bynk-emit/src/project.rs) needs it to build an external
provider’s own deps constructor argument — this variant’s own doc
comment already claimed given “lowers unconditionally” (P6.14’s
own review of #1186) before this fix actually made that true.
Trait Implementations§
Source§impl Clone for ProviderBody
impl Clone for ProviderBody
Source§fn clone(&self) -> ProviderBody
fn clone(&self) -> ProviderBody
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProviderBody
impl RefUnwindSafe for ProviderBody
impl Send for ProviderBody
impl Sync for ProviderBody
impl Unpin for ProviderBody
impl UnsafeUnpin for ProviderBody
impl UnwindSafe for ProviderBody
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<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);