Schema.Union<readonly [typeof Reachable, typeof Unreachable]>One node's row in byNode.
wire schemasbyNode
Source src/FleetHealth.ts:781 lines
export const const nodeReport: Schema.Union<
readonly [typeof Reachable, typeof Unreachable]
>
const nodeReport: {
Type: { [K in keyof Members]: Members[K]["Type"]; }[number];
Encoded: { [K in keyof Members]: Members[K]["Encoded"]; }[number];
DecodingServices: { [K in keyof Members]: Members[K]["DecodingServices"]; }[number];
EncodingServices: { [K in keyof Members]: Members[K]["EncodingServices"]; }[number];
Iso: { [K in keyof Members]: Members[K]["Iso"]; }[number];
members: Members;
mapMembers: (f: (members: readonly [typeof Reachable, typeof Unreachable]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Reachable | Unreachable, readonly []>) => Schema.Union<readonly [typeof Reachable, typeof Unreachable]>;
annotateKey: (annotations: Schema.Annotations.Key<Reachable | Unreachable>) => Schema.Union<readonly [typeof Reachable, typeof Unreachable]>;
check: (checks_0: Check<Reachable | Unreachable>, ...checks: Array<Check<Reachable | Unreachable>>) => Schema.Union<readonly [typeof Reachable, typeof Unreachable]>;
rebuild: (ast: Union<Declaration>) => Schema.Union<readonly [typeof Reachable, typeof Unreachable]>;
make: (input: Reachable | Unreachable, options?: Schema.MakeOptions) => Reachable | Unreachable;
makeOption: (input: Reachable | Unreachable, options?: Schema.MakeOptions) => Option<Reachable | Unreachable>;
makeEffect: (input: Reachable | Unreachable, options?: Schema.MakeOptions) => Effect.Effect<Reachable | Unreachable, Schema.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; <…;
}
One node's row in
byNode
.
nodeReport = import SchemaSchema.function Union<readonly [typeof Reachable, typeof Unreachable]>(members: readonly [typeof Reachable, typeof Unreachable], options?: {
mode?: "anyOf" | "oneOf";
}): Schema.Union<readonly [typeof Reachable, typeof Unreachable]>
Creates a union schema from an array of member schemas. Members are tested in
order; the first match is returned.
Details
Optionally, specify mode:
"anyOf" (default) — matches if any member matches.
"oneOf" — matches if exactly one member matches.
Example (Defining a string or number union)
import { Schema } from "effect"
const schema = Schema.Union([Schema.String, Schema.Number])
Schema.decodeUnknownSync(schema)("hello") // "hello"
Schema.decodeUnknownSync(schema)(42) // 42
Union([class Reachableclass Reachable {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Reachable'>; readonly status: Schema.Literals<readonly ['ok', 'degraded']>; readonly resources: Schema.$Array<any> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | unde…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('status' | 'resources' | '_tag') & keyof NewFields extends never ? { readonly _tag: …;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Reachable, readonly [Schema.TaggedStruct<'Reachable', { readonly status: Schema.Literals<readonly ['ok', 'degraded']>; readonly resources: Schema.$Array<any> }>]>) => Schema.decodeTo<Schema.declareCo…;
annotateKey: (annotations: Schema.Annotations.Key<Reachable>) => Schema.decodeTo<Schema.declareConstructor<Reachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reachable'>; readonly status: Schema.Literals<readonly ['ok', 'degraded']>; re…;
check: (checks_0: Check<Reachable>, ...checks: Array<Check<Reachable>>) => Schema.decodeTo<Schema.declareConstructor<Reachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reachable'>; readonly status: Schema.Literals<readonly ['ok', …;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<Reachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Reachable'>; readonly status: Schema.Literals<readonly ['ok', 'degraded']>; readonly resources: Schema.$Arra…;
make: (input: { readonly status: 'ok' | 'degraded'; readonly resources: ReadonlyArray<any>; readonly _tag?: 'Reachable' | undefined }, options?: Schema.MakeOptions) => Reachable;
makeOption: (input: { readonly status: 'ok' | 'degraded'; readonly resources: ReadonlyArray<any>; readonly _tag?: 'Reachable' | undefined }, options?: Schema.MakeOptions) => Option<Reachable>;
makeEffect: (input: { readonly status: 'ok' | 'degraded'; readonly resources: ReadonlyArray<any>; readonly _tag?: 'Reachable' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<Reachable, Schema.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; <…;
}
Peer answered — carry its local aggregate.
Reachable, class Unreachableclass Unreachable {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Unreachable'> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof ('_tag' & keyof NewFields extends never ? { readonly _tag: Schema.tag<'Unreachable'>; …;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Unreachable, readonly [Schema.TaggedStruct<'Unreachable', {}>]>) => Schema.decodeTo<Schema.declareConstructor<Unreachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Unreachable'> }, 'En…;
annotateKey: (annotations: Schema.Annotations.Key<Unreachable>) => Schema.decodeTo<Schema.declareConstructor<Unreachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Unreachable'> }, 'Encoded'>, readonly [Schema.TaggedStruct<'Unreachable', …;
check: (checks_0: Check<Unreachable>, ...checks: Array<Check<Unreachable>>) => Schema.decodeTo<Schema.declareConstructor<Unreachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Unreachable'> }, 'Encoded'>, readonly [Schema.TaggedStru…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<Unreachable, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Unreachable'> }, 'Encoded'>, readonly [Schema.TaggedStruct<'Unreachable', {}>], Schema.Struct.ReadonlySide…;
make: (input: void | { readonly _tag?: 'Unreachable' | undefined }, options?: Schema.MakeOptions) => Unreachable;
makeOption: (input: void | { readonly _tag?: 'Unreachable' | undefined }, options?: Schema.MakeOptions) => Option<Unreachable>;
makeEffect: (input: void | { readonly _tag?: 'Unreachable' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<Unreachable, Schema.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; <…;
}
Peer pick failed (timeout / connect / RPC) — not the same as ready: false.
Unreachable]);
Referenced by 1 symbols