pub struct UnitTable {Show 21 fields
pub exec_plan: Arc<ExecPlan>,
pub kind: Option<UnitKind>,
pub types: HashMap<String, Arc<TypeDecl>>,
pub fns: HashMap<String, Arc<FnDecl>>,
pub methods: HashMap<String, MethodTable>,
pub capabilities: HashMap<String, CapabilityDecl>,
pub providers: HashMap<String, ProviderDecl>,
pub services: HashMap<String, ServiceDecl>,
pub agents: HashMap<String, Arc<AgentDecl>>,
pub removed_agents: Vec<RemovedAgentDecl>,
pub actors: HashMap<String, ActorDecl>,
pub exported_capabilities: HashSet<String>,
pub events: HashMap<String, EventDecl>,
pub assets: HashMap<String, AssetDecl>,
pub embeds: HashMap<String, EmbedDecl>,
pub consts: HashMap<String, ConstDecl>,
pub flattened_caps: HashMap<String, String>,
pub consumed_type_aliases: HashMap<String, ConsumedTypeAlias>,
pub unselected_consumed_types: BTreeSet<String>,
pub unlisted_consumed_types: BTreeSet<String>,
pub derived: HashMap<String, DerivedInstance>,
}Expand description
Combined symbol tables for a single logical commons or context.
Fields§
§exec_plan: Arc<ExecPlan>#2719: the build’s needs-context set, stamped on once every unit is
checked (empty before). Emission reads it to decide which handlers’ deps
carry the execution context; a table is the one value every such gate
already holds.
kind: Option<UnitKind>§types: HashMap<String, Arc<TypeDecl>>§fns: HashMap<String, Arc<FnDecl>>§methods: HashMap<String, MethodTable>§capabilities: HashMap<String, CapabilityDecl>Per-context capabilities (v0.5). Empty for commons.
providers: HashMap<String, ProviderDecl>Per-context providers (v0.5). One provider per capability in v0.5. Key: capability name. Value: provider declaration.
services: HashMap<String, ServiceDecl>Per-context services (v0.5). Empty for commons.
agents: HashMap<String, Arc<AgentDecl>>Per-context agents (v0.5). Empty for commons.
removed_agents: Vec<RemovedAgentDecl>State-migrations S3 (#2248): the context’s removed agent
declarations, across its files.
actors: HashMap<String, ActorDecl>v0.45: actors — boundary contracts consumed by handler by clauses.
exported_capabilities: HashSet<String>v0.15: capability names this context offers to consumers via
exports capability { … }. Empty for commons.
events: HashMap<String, EventDecl>Events track, slice 0 (spine #936): event declarations. Each also
registers into types (via EventDecl::as_type_decl) so ordinary
type-reference/exports/consumes/construction machinery treats it like
any other record type; this table is the separate “is name
specifically an event” answer — owner-only emission and the
from Events(E)/Events.emit[E] “must name a declared event, not
just any type” checks key off it. Empty for commons/adapters
(bynk.event.outside_context rejects it there).
assets: HashMap<String, AssetDecl>#1883, slice 1a: asset declarations, by name — values of the
built-in type Asset, local to this unit. A context or commons only
(bynk.asset.outside_context_or_commons); a unit’s visible assets
add those of the commons it uses (assets::compose_unit_assets).
embeds: HashMap<String, EmbedDecl>#2387, slice 1: embed declarations, by name — String constants
holding a project file’s text, local to this unit. A context or commons
only (bynk.embed.outside_context_or_commons); a unit’s visible embeds
add those of the commons it uses (embeds::compose_unit_embeds).
consts: HashMap<String, ConstDecl>#2617: const declarations, by name — values of their annotated type,
local to this unit. A context or commons only
(bynk.resolve.const_outside_context_or_commons); a unit’s visible
constants add those of the commons it uses
(consts::compose_unit_consts).
flattened_caps: HashMap<String, String>#291: the capabilities this unit flattens in with consumes U { Cap },
each mapped to the unit providing it — phase_resolve_consumes’s
per-unit answer, recorded by record_flattened_caps so a test body’s
privileged view sees the target’s platform seams.
consumed_type_aliases: HashMap<String, ConsumedTypeAlias>#2887: the exported types this unit renames with consumes U { T as Alias }, keyed by the alias. Recorded by record_flattened_caps.
unselected_consumed_types: BTreeSet<String>#3536: the types of the first-party units this unit consumes with a
braced list (consumes bynk { Logger }) that the list does not name.
A selective consumes brings in only what it lists, so these are not
candidates for a name clash or a bare-variant lookup, and a declaration
of this unit’s own wins over them. Recorded by
record_unselected_consumed_types.
unlisted_consumed_types: BTreeSet<String>#3536: every type of those units the braces do not list, including the
ones a listed capability’s signatures reach (which stay in scope as
values, so UnitTable::unselected_consumed_types leaves them out).
What bynk.consumes.type_not_selected is reported against.
derived: HashMap<String, DerivedInstance>S4a (#1966): the derived capabilities (capability Sessions = Kv)
this context declares, by name, once resolved to their base by
crate::project_model::phase_resolve_derived. Each is also in
UnitTable::capabilities, with its base’s operations, so given,
calls and test views treat it as an ordinary capability.
Implementations§
Source§impl UnitTable
impl UnitTable
Sourcepub fn unselected_names(&self) -> HashSet<String>
pub fn unselected_names(&self) -> HashSet<String>
#3536: UnitTable::unselected_consumed_types as a set.
Sourcepub fn has_private(&self) -> bool
pub fn has_private(&self) -> bool
#2618: does this unit declare anything private?
Sourcepub fn importable(&self) -> Cow<'_, UnitTable>
pub fn importable(&self) -> Cow<'_, UnitTable>
#2618: the table as a unit that uses this one sees it — without its
private declarations. A private type’s methods go with it, public or
not: an importer can neither name the type nor reach a value of it.
Borrowed when the unit declares nothing private (every unit before #2618), so an import costs no copy. The unit itself, and its suites, read the full table instead.
Sourcepub fn private_subjects(&self) -> Vec<(String, &'static str)>
pub fn private_subjects(&self) -> Vec<(String, &'static str)>
#2618: the declarations this unit makes private, each keyed by the
subject an unknown-name diagnostic names it by (f, T, or a method
as T.m), with its kind. A reference from an importing unit that
meets one is bynk.visibility.private_item
(crate::resolver::rewrite_private_references).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UnitTable
impl RefUnwindSafe for UnitTable
impl Send for UnitTable
impl Sync for UnitTable
impl Unpin for UnitTable
impl UnsafeUnpin for UnitTable
impl UnwindSafe for UnitTable
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<'a, T> FromIn<'a, T> for T
impl<'a, T> FromIn<'a, T> for T
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 more§impl<'a, T, U> IntoIn<'a, U> for Twhere
U: FromIn<'a, T>,
impl<'a, T, U> IntoIn<'a, U> for Twhere
U: FromIn<'a, T>,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§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);