MCPcopy
hub / github.com/Effect-TS/effect / EffectPrimitiveFailure

Class EffectPrimitiveFailure

packages/effect/src/internal/core.ts:164–210  ·  view source on GitHub ↗

@internal

Source from the content-addressed store, hash-verified

162
163/** @internal */
164class EffectPrimitiveFailure {
165 public effect_instruction_i0 = undefined
166 public effect_instruction_i1 = undefined
167 public effect_instruction_i2 = undefined
168 public trace = undefined;
169 [EffectTypeId] = effectVariance
170 constructor(readonly _op: Primitive["_op"]) {
171 // @ts-expect-error
172 this._tag = _op
173 }
174 [Equal.symbol](this: {}, that: unknown) {
175 return exitIsExit(that) && that._op === "Failure" &&
176 // @ts-expect-error
177 Equal.equals(this.effect_instruction_i0, that.effect_instruction_i0)
178 }
179 [Hash.symbol](this: {}) {
180 return pipe(
181 // @ts-expect-error
182 Hash.string(this._tag),
183 // @ts-expect-error
184 Hash.combine(Hash.hash(this.effect_instruction_i0)),
185 Hash.cached(this)
186 )
187 }
188 get cause() {
189 return this.effect_instruction_i0
190 }
191 pipe() {
192 return pipeArguments(this, arguments)
193 }
194 toJSON() {
195 return {
196 _id: "Exit",
197 _tag: this._op,
198 cause: (this.cause as any).toJSON()
199 }
200 }
201 toString() {
202 return format(this.toJSON())
203 }
204 [NodeInspectSymbol]() {
205 return this.toJSON()
206 }
207 [Symbol.iterator]() {
208 return new SingleShotGen(new YieldWrap(this))
209 }
210}
211
212/** @internal */
213class EffectPrimitiveSuccess {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected