pub struct ComposeUnit {Show 17 fields
pub is_context: bool,
pub consumes: Vec<String>,
pub has_services: bool,
pub has_agents: bool,
pub binds_caller: bool,
pub publishes: bool,
pub exec: ExecNeeds,
pub providers: Vec<String>,
pub derived: Vec<String>,
pub handler_cross_caps: BTreeMap<String, String>,
pub provider_cross_caps: BTreeMap<String, String>,
pub surfaces: Vec<ConsumedSurface>,
pub subscriber_envelopes: BTreeMap<String, bool>,
pub called: Vec<String>,
pub bare_kv: bool,
pub bare_singletons: Vec<String>,
pub idempotency: bool,
}Expand description
One unit of the plan: facts, not text.
Fields§
§is_context: bool§consumes: Vec<String>Consumed units, in declaration order (a dependency edge list, not a rendering order).
has_services: bool§has_agents: bool§binds_caller: bool§publishes: bool§exec: ExecNeeds§providers: Vec<String>Own providers’ capability keys, in dependency order.
derived: Vec<String>§handler_cross_caps: BTreeMap<String, String>§provider_cross_caps: BTreeMap<String, String>§surfaces: Vec<ConsumedSurface>Consumed contexts that have services, sorted by target.
subscriber_envelopes: BTreeMap<String, bool>For each from Events service the unit hosts: whether its on event
handler is handed the event’s envelope (wants_envelope).
called: Vec<String>The consumed contexts its bodies and agents call, in name order
(ComposeUnitFacts::called).
bare_kv: boolIts closure reaches the bare KV namespace.
bare_singletons: Vec<String>The bare one-per-Worker capabilities its closure reaches.
idempotency: boolA body calls Idempotency.
Implementations§
Source§impl ComposeUnit
impl ComposeUnit
Sourcepub fn hosted_wants_envelope(&self, unit: &str, service: &str) -> bool
pub fn hosted_wants_envelope(&self, unit: &str, service: &str) -> bool
Whether the on event handler of service, a from Events service this
unit hosts, is handed the envelope. Every hosted events service has a
shape, so a miss is an internal error and not a false: the callee would
still insert its positional envelope parameter and bind deps into it.
Sourcepub fn cross_caps(&self) -> BTreeMap<String, String>
pub fn cross_caps(&self) -> BTreeMap<String, String>
Every cross-context capability the unit uses, handlers’ and providers’ together; a key both name keeps the handlers’ source. Which of the two sets a target instantiates at the top level is the renderer’s choice (divergence 3).
Trait Implementations§
Source§impl Clone for ComposeUnit
impl Clone for ComposeUnit
Source§fn clone(&self) -> ComposeUnit
fn clone(&self) -> ComposeUnit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComposeUnit
impl Debug for ComposeUnit
Source§impl PartialEq for ComposeUnit
impl PartialEq for ComposeUnit
impl Eq for ComposeUnit
impl StructuralPartialEq for ComposeUnit
Auto Trait Implementations§
impl Freeze for ComposeUnit
impl RefUnwindSafe for ComposeUnit
impl Send for ComposeUnit
impl Sync for ComposeUnit
impl Unpin for ComposeUnit
impl UnsafeUnpin for ComposeUnit
impl UnwindSafe for ComposeUnit
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);