Hyperlinkv0.8.0-beta.28

ApiMetrics

ApiMetrics.layerForconstsrc/ApiMetrics.ts:197

Like layer, but takes the outbound client's Service class as a witness so the compiler proves the metrics tag's clientId matches that client's Context key (correct by construction). _client is type-only — erased at runtime; the layer is exactly layer(tag, options).

layers & servinglayer
Source src/ApiMetrics.ts:1979 lines
export const layerFor = <
  Self,
  const ClientId extends string,
  Client extends Context.ServiceClass<any, ClientId, any>,
>(
  tag: ApiMetricsTag<Self> & { readonly [clientIdSym]: ClientId },
  _client: Client,
  options?: ApiMetricsTagOptions,
): Layer.Layer<Self, never, Scope.Scope> => layer(tag, options);