Skip to main content

Callee

Enum Callee 

Source
pub enum Callee {
Show 17 variants Fn(Arc<FnDecl>), Value(String), Ctor { sum: Arc<TypeDecl>, tag: String, }, Refine(Arc<TypeDecl>), Unsafe(Arc<TypeDecl>), Static(Arc<FnDecl>), Method(Arc<FnDecl>), Kernel { recv: TyId, op: String, }, Intrinsic { ns: &'static str, op: String, }, Capability { cap: String, op: String, }, CrossCap { unit: String, cap: String, op: String, }, Cross { unit: String, service: String, }, AgentInit(String), Agent { agent: String, handler: String, }, TestService { service: String, address: String, }, Store { field: String, op: String, }, Query { field: String, op: String, role: QueryRole, },
}
Expand description

P6.0 (design/tracks/the-ir.md §6, #1139): a resolved classification of a call-shaped expression, recorded once by the checker’s own dispatch (checker::calls) rather than re-derived by each later consumer — closing R6.10’s duplicated-classification gap between bynk-check and bynk-emit’s lower_method_call/lower_call.

Adapted to the identity handles this checker already has (Decision A, ADR 0333, the-ir-callee-in-bynk-check) rather than the reference document’s DefId/LocalId/VariantId/OpId arena — none of which exists here, since the Resolve phase that would mint them was never built (project-model.md §3.4 deferred it to phase 8). Arc<FnDecl>/Arc<TypeDecl> are already-cheap resolved handles (ResolvedCommons::fns/types); every other variant’s identity is a name, exactly as the checker already keys capabilities, store fields, units, and agents.

Recorded at each dispatch decision as soon as it is known — including on an error sub-branch (an arity mismatch, an undeclared capability) — since the kind of call is fixed by dispatch, not by whether it went on to type-check cleanly.

Variants§

§

Fn(Arc<FnDecl>)

A free function call.

§

Value(String)

Applying a function-typed local or parameter (f(x) where f is in scope, not declared). No stable id exists for a local beyond its name — the reference’s LocalId presumes the same Resolve phase Decision A declines to build here.

§

Ctor

Sum-variant construction, bare (Some(x)) or qualified (Opt.Some(x)).

Fields

§

Refine(Arc<TypeDecl>)

T.of(value) — the refined/opaque runtime constructor.

§

Unsafe(Arc<TypeDecl>)

T.unsafe(value) — the opaque constructor, defining-unit only.

§

Static(Arc<FnDecl>)

A user-declared static method (Type.method(...)).

§

Method(Arc<FnDecl>)

A user-declared instance method (UFCS), generic or not.

§

Kernel

A built-in method on a value — the collection/query/stream/ connection/numeric/duration/instant/bytes/string/option/result/ effect kernels, including the refined-receiver fallback (ADR 0168). recv is the receiver’s own checked type; no KernelOp enum exists yet in this crate (R6.11), so the operation is named, not typed.

Fields

§recv: TyId
§

Intrinsic

A built-in static constructor with no declaring type — List.empty, Map.empty, Int.parse/Float.parse, Duration.millis, Instant.fromEpochMillis, Bytes.fromUtf8/fromBase64/empty, Json.decode/encode, Stream.of.

Fields

§ns: &'static str
§

Capability

A same-context capability operation call (Cap.op(...)).

Fields

§

CrossCap

A cross-context capability operation call (B.Cap.op(...) / Alias.Cap.op(...)).

Fields

§unit: String
§

Cross

A cross-context service call (B.service(...) / Alias.service(...)).

Fields

§unit: String
§service: String
§

AgentInit(String)

AgentName(key) — agent instance construction. No slot exists for this in the reference’s own Callee taxonomy (Part 6.5 only names handler dispatch); added here since this slice covers every call shape check_call dispatches, not only the ones the reference anticipated.

§

Agent

agent.handler(args) — agent handler dispatch.

Fields

§agent: String
§handler: String
§

TestService

A test-body service address (svc.call/svc.<VERB>("/path", …)/ svc.schedule(...)/svc.message(...)). check_test_service_address always returns None by design (the runner recovers the outcome type at runtime) — this classification exists purely for a later consumer (e.g. go-to-definition on the address), not typing.

Fields

§service: String
§address: String
§

Store

An effectful <field>.<op>(…) storage operation on a store Map/Set/Cache/Log/Cell field — R6.5’s own named target (P6.2, #1143): a mutation detector keyed on this variant, not a receiver’s bare name, cannot miss a mutation reached through a non-Ident receiver or false-negative on a shadowed local, the defect class block_writes_state’s mutating_op still carries. field is the store field’s own name (no FieldId arena exists — same adaptation check_store_*_op’s own lookups already use). Note this is recorded outside calls.rs’s six functions — the store-field ladder lives directly in checker.rs’s own type_of, never reaching any of them — extending P6.0’s own recording surface past the boundary its “Done when” deliberately drew.

Fields

§field: String
§

Query

A query builder/terminal call that lifts a bare store Map/Log field into a lazy Query[V] (is_query_op’s own gate, checker.rs’s type_of) — R6.12’s own named target (P6.2, #1143). field names the store field being lifted — without it, a chain rooted at this call (orders.filter(p).count()) would carry no identity for orders anywhere in the classification, the same information loss R6.5 exists to close on the write side. role is read back from the checker’s own typing decision for this exact call (Ty::Query(_) result ⇒ Builder, anything else ⇒ Terminal), not a second name-list classifier alongside is_query_op’s. A chained builder/terminal call on an already-Query-typed receiver (.filter(p).count()’s own .count()) is not this variant — it reaches check_method_call’s ordinary kernel dispatch and is Callee::Kernel already (P6.0); Query here exists only because the lift call’s own outer expression never passes through any of calls.rs’s six functions to get one.

Fields

§field: String

Trait Implementations§

Source§

impl Clone for Callee

Source§

fn clone(&self) -> Callee

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Callee

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Paint for T
where T: ?Sized,

§

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 primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

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>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

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 bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

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 mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

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.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

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);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.