Another process already owns this HyperService key — original is where to dial.
errors
Source src/Lookup.ts:847 lines
export class class DuplicateIdentityclass DuplicateIdentity {
_tag: 'DuplicateIdentity';
key: string;
original: Endpoint;
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Another process already owns this HyperService key — original is where to dial.
DuplicateIdentity extends import SchemaSchema.const TaggedErrorClass: {
<Self = never, Brand = {}>(
identifier?: string
): {
<
Tag extends string,
Fields extends Struct.Fields
>(
tag: Tag,
fields: Fields,
annotations?: Annotations.Declaration<
Self,
readonly [TaggedStruct<Tag, Fields>]
>
): [Self] extends [never]
? MissingSelfGeneric<"Schema.TaggedErrorClass">
: Class<
Self,
TaggedStruct<Tag, Fields>,
Cause_.YieldableError & Brand
>
<
Tag extends string,
S extends Struct<Struct.Fields>
>(
tag: Tag,
schema: S,
annotations?: Annotations.Declaration<
Self,
readonly [
Struct<
Simplify<
{
readonly _tag: tag<Tag>
} & S["fields"]
>
>
]
>
): [Self] extends [never]
? MissingSelfGeneric<"Schema.TaggedErrorClass">
: Class<
Self,
Struct<
Simplify<
{
readonly _tag: tag<Tag>
} & S["fields"]
>
>,
Cause_.YieldableError & Brand
>
}
}
Defines a schema-backed yieldable error class with an automatically populated
_tag field.
When to use
Use to define typed errors that are schema validated, yielded in Effect.gen,
and matched as tagged union members.
Example (Defining a tagged error class)
import { Effect, Schema } from "effect"
class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
id: Schema.Number
}) {}
const program = Effect.gen(function*() {
yield* new NotFound({ id: 42 })
})
TaggedErrorClass<class DuplicateIdentityclass DuplicateIdentity {
_tag: 'DuplicateIdentity';
key: string;
original: Endpoint;
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Another process already owns this HyperService key — original is where to dial.
DuplicateIdentity>()(
"DuplicateIdentity",
{
key: Schema.String(property) key: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
key: import SchemaSchema.const String: Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String,
original: typeof Endpoint(property) original: {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; readonly path: Schema.optionalKey<Schema.String> }) => To, option…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('kind' | 'url' | 'path' | 'nodeKey') & keyof NewFields extends never ? { readonly no…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Endpoint, readonly [Schema.Struct<{ readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; read…;
annotateKey: (annotations: Schema.Annotations.Key<Endpoint>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string…;
check: (checks_0: Check<Endpoint>, ...checks: Array<Check<Endpoint>>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonl…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, readonly [Sch…;
make: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: MakeOptions) => Endpoint;
makeOption: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: MakeOptions) => Option_.Option<Endpoint>;
makeEffect: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: MakeOptions) => Effect.Effect<Endpoint, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
original: class Endpointclass Endpoint {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; readonly path: Schema.optionalKey<Schema.String> }) => To, option…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('kind' | 'url' | 'path' | 'nodeKey') & keyof NewFields extends never ? { readonly no…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Endpoint, readonly [Schema.Struct<{ readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; read…;
annotateKey: (annotations: Schema.Annotations.Key<Endpoint>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string…;
check: (checks_0: Check<Endpoint>, ...checks: Array<Check<Endpoint>>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonl…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, readonly [Sch…;
make: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: MakeOptions) => Endpoint;
makeOption: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: MakeOptions) => Option_.Option<Endpoint>;
makeEffect: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: MakeOptions) => Effect.Effect<Endpoint, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Where a winning claimant / advertised node lives — node key + transport address.
Endpoint,
},
) {}