Skip to main content

Callee

Enum Callee 

Source
pub enum Callee {
Show 28 variants Fn(Arc<FnDecl>, Vec<TyId>), FnValue(Arc<FnDecl>, Vec<TyId>), Value(String), Ctor { sum: Arc<TypeDecl>, tag: String, }, Refine(Arc<TypeDecl>), Unsafe(Arc<TypeDecl>), Static(Arc<FnDecl>, Vec<TyId>), Method(Arc<FnDecl>, Vec<TyId>), Kernel { recv: TyId, op: KernelOp, }, SignedCookie { actor: String, issue: bool, }, CookieField { record: String, field: String, expire: bool, }, Intrinsic { ns: IntrinsicNs, op: StaticOp, }, Fault { kind: &'static str, }, Capability { cap: String, op: String, wire: Option<Arc<CapEncoding>>, first_party: Option<FirstPartyCap>, event: Option<String>, }, D1Select { cap: String, row: TyId, sql: String, first: bool, pg: bool, mysql: bool, }, D1Sql(D1SqlSite), D1Peek { participant: String, binding: String, local: String, }, D1Decode(D1DecodeSite), CrossCap { unit: String, cap: String, op: String, wire: Option<Arc<CapEncoding>>, first_party: Option<FirstPartyCap>, }, Cross { unit: String, service: String, }, AgentInit(String), Agent { agent: String, handler: String, }, TestService { service: String, address: HandlerAddress, extra_headers: bool, }, TestAssetFetch { service: String, }, Store { field: String, op: StoreEntryOp, }, Query { field: String, op: StoreQueryOp, role: QueryRole, }, Const(String, Option<Box<D1SqlSite>>), Principal(CallSitePrincipal),
}
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>, Vec<TyId>)

A free function call. The Vec<TyId> is the call’s comparator witnesses (constrained-generics slice 1): the type argument of each Ord-bounded type parameter of the callee, in codable::witness_list order. Empty for a callee with no Ord bound, which is almost every call.

§

FnValue(Arc<FnDecl>, Vec<TyId>)

A generic function with Ord bounds named as a value (xs.map(max)), instantiated at the reference: its witnesses, as for Callee::Fn.

§

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>, Vec<TyId>)

A user-declared static method (Type.method(...)). The Vec<TyId> is the call’s witnesses, as for Callee::Fn (constrained generics slice 4); empty for a static on a non-generic type.

§

Method(Arc<FnDecl>, Vec<TyId>)

A user-declared instance method (UFCS), generic or not. The Vec<TyId> is the call’s comparator witnesses, as for Callee::Fn.

§

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; op is the resolved operation on it (#3164), so a consumer matches on the enum rather than on the method’s spelling.

Fields

§recv: TyId
§

SignedCookie

#3386: Actor.issue(identity) / Actor.expire() on a local SignedCookie actor: the session cookie the actor mints, or its matching deletion. issue reads the Clock and is an Effect; expire is pure.

Fields

§actor: String
§issue: bool
§

CookieField

#3446: Record.field.cookie(value) / Record.field.expire() on a cookie record: the Cookie the field’s decoder reads back (named by its wire name, valued by the decoder’s leaf rules), or its matching deletion.

Fields

§record: String
§field: String
§expire: bool
§

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.

ns and op (1A.33, Decision B) are closed: built only for a method the namespace has, so an unknown method gets no callee. Build one with Callee::intrinsic.

§

Fault

#2620: unreachable(msg) / todo(msg) — the ambient built-ins that fault when evaluated. kind is the runtime fault kind (Unreachable / Todo); the call’s type is Ty::Never.

Fields

§kind: &'static str
§

Capability

A same-context capability operation call (Cap.op(...)). wire is set for an operation with Codable parameters: how the call encodes them.

Fields

§first_party: Option<FirstPartyCap>

1A.33 (Decision A): which first-party capability this is, when it is bynk’s own (crate::firstparty::resolve); None for any other capability, including a same-named one from another unit (#934).

§event: Option<String>

#4113: for bynk’s own Events.emit, the event the call emits: its type argument, written or inferred from the argument, once the owner check has accepted it. The one place the emitter and the architecture model read the emitted event from.

§

D1Select

#2865: Cap.select[T](tail, params) / Cap.firstAs[T](tail, params) on a derived D1 instance. Not a declared operation: the compiler writes sql (the column list from the row T, then the literal tail) and lowers over all/first and the decodeSql codec.

Fields

§row: TyId
§first: bool
§pg: bool

Hyperdrive H3 (#3320): the instance is a Postgres one, so the read decodes with Postgres’ rules and fails as a PgReadError.

§mysql: bool

Hyperdrive H5 (#3322): the instance is a MySql one: the read quotes columns with backticks, decodes MySQL’s text forms (the Postgres pass over Int fields) and fails as a MySqlReadError.

§

D1Sql(D1SqlSite)

#3070: a literal SQL statement of a derived D1 instance, recorded under the SQL argument’s id (not the call’s, which keeps its own entry), so the project phase can prepare it against the binding’s migrations.

§

D1Peek

#3147: D1.peek(<participant>.<Cap>). The case holds a capability over the participant’s test database, on the binding of its env, as deps.<local>; calls on the handle are capability calls on local.

Fields

§participant: String
§binding: String
§local: String
§

D1Decode(D1DecodeSite)

#3139: a Json.decodeSql[T](x) whose x is the rows of a literal D1 read, recorded under the argument’s id, so the project phase can check T’s fields against the statement’s result columns.

§

CrossCap

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

Fields

§unit: String
§first_party: Option<FirstPartyCap>

1A.33 (Decision A): which first-party capability unit.cap is, when it is bynk’s own.

§

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. extra_headers (#2910): a trailing RequestHeaders argument sent to a route that declares no headers: parameter — a system-tier-only form.

address (1A.33, Decision D) is typed: where the address is aimed.

Fields

§service: String
§extra_headers: bool
§

TestAssetFetch

#1883, slice 3: svc.GET(asset) in a test body — an asset fetch, answered by the asset tier rather than a handler. Its own variant (review of #1922) so no route address can be mistaken for it.

Fields

§service: 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.

op (1A.33, Decision C) is typed, built only for an operation the field’s kind has.

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.

op (1A.33, Decision C) is typed.

Fields

§field: String
§

Const(String, Option<Box<D1SqlSite>>)

#2617: a bare name that resolves to a const (one of this unit’s, a sibling file’s or a usesd commons’), not a local of the same name. Not call-shaped in the source, but emitted as one: each constant is a hoisted, cached function (Name()), so the lowering must know which idents name a constant, and only the checker’s scope walk can tell a constant from a local that shadows it. Recorded like the bare HttpResult variant reference (Callee::Intrinsic).

#3108: when the name is a D1 call’s SQL argument, the second field keeps that statement’s Callee::D1Sql site, which this entry would otherwise replace (one id, one entry), so the constant’s SQL is still prepared.

§

Principal(CallSitePrincipal)

1A.33: what a call-site principal clause (by Nobody, by Forged, by User("bob")) is, recorded under the clause’s own CallSiteActor::id. Not call-shaped: it is the one place the reserved principal names are classified, for the checker’s own rules and the emitter alike.

Implementations§

Source§

impl Callee

Source

pub fn intrinsic(op: StaticOp) -> Callee

A static-intrinsic callee for the resolved operation op.

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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.