File size: 1,599 Bytes
31e8457
 
e391660
 
31e8457
e391660
31e8457
 
 
e391660
 
31e8457
e391660
31e8457
 
 
 
 
e391660
 
31e8457
e391660
31e8457
 
 
 
 
e391660
 
 
31e8457
 
 
e391660
31e8457
e391660
 
 
31e8457
e391660
31e8457
 
 
 
 
 
 
 
 
 
 
 
 
e391660
 
 
31e8457
e391660
31e8457
 
 
 
 
 
e391660
 
31e8457
e391660
31e8457
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import * as Schema from "../../Schema.js";
/**
 * Converts a bigint or string request id into the branded `RequestId` type.
 *
 * @category request
 * @since 4.0.0
 */
export const RequestId = id => typeof id === "bigint" ? id : BigInt(id);
/**
 * Represents the reusable `Eof` message value.
 *
 * @category request
 * @since 4.0.0
 */
export const constEof = {
  _tag: "Eof"
};
/**
 * Represents the reusable `Ping` message value.
 *
 * @category request
 * @since 4.0.0
 */
export const constPing = {
  _tag: "Ping"
};
/**
 * The brand identifier used by the `ResponseId` type.
 *
 * @category type IDs
 * @since 4.0.0
 */
export const ResponseIdTypeId = "~effect//rpc/RpcServer/ResponseId";
const encodeDefect = /*#__PURE__*/Schema.encodeSync(/*#__PURE__*/Schema.Defect());
/**
 * Creates an encoded terminal response for a request whose exit is a defect
 * encoded with `Schema.Defect()`.
 *
 * @category response
 * @since 4.0.0
 */
export const ResponseExitDieEncoded = options => ({
  _tag: "Exit",
  requestId: options.requestId.toString(),
  exit: {
    _tag: "Failure",
    cause: [{
      _tag: "Die",
      defect: encodeDefect(options.defect)
    }]
  }
});
/**
 * Creates a transport-encoded defect response by encoding the input with
 * `Schema.Defect()`.
 *
 * @category response
 * @since 4.0.0
 */
export const ResponseDefectEncoded = input => ({
  _tag: "Defect",
  defect: encodeDefect(input)
});
/**
 * Represents the reusable `Pong` message value.
 *
 * @category response
 * @since 4.0.0
 */
export const constPong = {
  _tag: "Pong"
};
//# sourceMappingURL=RpcMessage.js.map