@@ -22,19 +22,19 @@ import Foundation
22
22
/// serialized and sent across the wire. The sender will receive an equivalent error on the other side.
23
23
///
24
24
/// Built-in types are included but developers may use any message string, with a max length of 256 bytes.
25
- struct RpcError : Error {
25
+ public struct RpcError : Error {
26
26
/// The error code of the RPC call. Error codes 1001-1999 are reserved for built-in errors.
27
27
///
28
28
/// See `RpcError.BuiltInError` for built-in error information.
29
- let code : Int
29
+ public let code : Int
30
30
31
31
/// A message to include. Strings over 256 bytes will be truncated.
32
- let message : String
32
+ public let message : String
33
33
34
34
/// An optional data payload. Must be smaller than 15KB in size, or else will be truncated.
35
- let data : String
35
+ public let data : String
36
36
37
- enum BuiltInError {
37
+ public enum BuiltInError {
38
38
case applicationError
39
39
case connectionTimeout
40
40
case responseTimeout
@@ -47,7 +47,7 @@ struct RpcError: Error {
47
47
case unsupportedServer
48
48
case unsupportedVersion
49
49
50
- var code : Int {
50
+ public var code : Int {
51
51
switch self {
52
52
case . applicationError: return 1500
53
53
case . connectionTimeout: return 1501
@@ -63,7 +63,7 @@ struct RpcError: Error {
63
63
}
64
64
}
65
65
66
- var message : String {
66
+ public var message : String {
67
67
switch self {
68
68
case . applicationError: return " Application error in method handler "
69
69
case . connectionTimeout: return " Connection timeout "
@@ -124,16 +124,16 @@ public typealias RpcHandler = (RpcInvocationData) async throws -> String
124
124
125
125
public struct RpcInvocationData {
126
126
/// A unique identifier for this RPC request
127
- let requestId : String
127
+ public let requestId : String
128
128
129
129
/// The identity of the RemoteParticipant who initiated the RPC call
130
- let callerIdentity : Participant . Identity
130
+ public let callerIdentity : Participant . Identity
131
131
132
132
/// The data sent by the caller (as a string)
133
- let payload : String
133
+ public let payload : String
134
134
135
135
/// The maximum time available to return a response
136
- let responseTimeout : TimeInterval
136
+ public let responseTimeout : TimeInterval
137
137
}
138
138
139
139
struct PendingRpcResponse {
0 commit comments