@agntcy/slim-bindings-node-linux-arm64-gnu 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/libslim_bindings.so +0 -0
- package/package.json +23 -0
- package/slim-bindings-node.d.ts +3692 -0
- package/slim-bindings-node.js +9962 -0
- package/slim-bindings-sys.d.ts +564 -0
- package/slim-bindings-sys.js +3240 -0
|
@@ -0,0 +1,3692 @@
|
|
|
1
|
+
import { RustBuffer, UniffiAbstractObject, uniffiTypeNameSymbol, destructorGuardSymbol, pointerLiteralSymbol } from 'uniffi-bindgen-react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Basic authentication configuration
|
|
4
|
+
*/
|
|
5
|
+
export type BasicAuth = {
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const BasicAuth: Readonly<{
|
|
10
|
+
/**
|
|
11
|
+
* Create a frozen instance of {@link BasicAuth}, with defaults specified
|
|
12
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
13
|
+
*/
|
|
14
|
+
create: any;
|
|
15
|
+
/**
|
|
16
|
+
* Create a frozen instance of {@link BasicAuth}, with defaults specified
|
|
17
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
18
|
+
*/
|
|
19
|
+
new: any;
|
|
20
|
+
/**
|
|
21
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
22
|
+
*/
|
|
23
|
+
defaults: () => Partial<BasicAuth>;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Build information for the SLIM bindings
|
|
27
|
+
*/
|
|
28
|
+
export type BuildInfo = {
|
|
29
|
+
/**
|
|
30
|
+
* Semantic version (e.g., "0.7.0")
|
|
31
|
+
*/ version: string;
|
|
32
|
+
/**
|
|
33
|
+
* Git commit hash (short)
|
|
34
|
+
*/ gitSha: string;
|
|
35
|
+
/**
|
|
36
|
+
* Build date in ISO 8601 UTC format
|
|
37
|
+
*/ buildDate: string;
|
|
38
|
+
/**
|
|
39
|
+
* Build profile (debug/release)
|
|
40
|
+
*/ profile: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const BuildInfo: Readonly<{
|
|
43
|
+
/**
|
|
44
|
+
* Create a frozen instance of {@link BuildInfo}, with defaults specified
|
|
45
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
46
|
+
*/
|
|
47
|
+
create: any;
|
|
48
|
+
/**
|
|
49
|
+
* Create a frozen instance of {@link BuildInfo}, with defaults specified
|
|
50
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
51
|
+
*/
|
|
52
|
+
new: any;
|
|
53
|
+
/**
|
|
54
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
55
|
+
*/
|
|
56
|
+
defaults: () => Partial<BuildInfo>;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Client configuration for connecting to a SLIM server
|
|
60
|
+
*/
|
|
61
|
+
export type ClientConfig = {
|
|
62
|
+
/**
|
|
63
|
+
* The target endpoint the client will connect to
|
|
64
|
+
*/ endpoint: string;
|
|
65
|
+
/**
|
|
66
|
+
* Origin (HTTP Host authority override) for the client
|
|
67
|
+
*/ origin?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Optional TLS SNI server name override
|
|
70
|
+
*/ serverName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Compression type
|
|
73
|
+
*/ compression?: CompressionType;
|
|
74
|
+
/**
|
|
75
|
+
* Rate limit string (e.g., "100/s" for 100 requests per second)
|
|
76
|
+
*/ rateLimit?: string;
|
|
77
|
+
/**
|
|
78
|
+
* TLS client configuration
|
|
79
|
+
*/ tls: TlsClientConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Keepalive parameters
|
|
82
|
+
*/ keepalive?: KeepaliveConfig;
|
|
83
|
+
/**
|
|
84
|
+
* HTTP Proxy configuration
|
|
85
|
+
*/ proxy: ProxyConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Connection timeout
|
|
88
|
+
*/ connectTimeout: number;
|
|
89
|
+
/**
|
|
90
|
+
* Request timeout
|
|
91
|
+
*/ requestTimeout: number;
|
|
92
|
+
/**
|
|
93
|
+
* Read buffer size in bytes
|
|
94
|
+
*/ bufferSize?: bigint;
|
|
95
|
+
/**
|
|
96
|
+
* Headers associated with gRPC requests
|
|
97
|
+
*/ headers: Map<string, string>;
|
|
98
|
+
/**
|
|
99
|
+
* Authentication configuration for outgoing RPCs
|
|
100
|
+
*/ auth: ClientAuthenticationConfig;
|
|
101
|
+
/**
|
|
102
|
+
* Backoff retry configuration
|
|
103
|
+
*/ backoff: BackoffConfig;
|
|
104
|
+
/**
|
|
105
|
+
* Arbitrary user-provided metadata as JSON string
|
|
106
|
+
*/ metadata?: string;
|
|
107
|
+
};
|
|
108
|
+
export declare const ClientConfig: Readonly<{
|
|
109
|
+
/**
|
|
110
|
+
* Create a frozen instance of {@link ClientConfig}, with defaults specified
|
|
111
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
112
|
+
*/
|
|
113
|
+
create: any;
|
|
114
|
+
/**
|
|
115
|
+
* Create a frozen instance of {@link ClientConfig}, with defaults specified
|
|
116
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
117
|
+
*/
|
|
118
|
+
new: any;
|
|
119
|
+
/**
|
|
120
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
121
|
+
*/
|
|
122
|
+
defaults: () => Partial<ClientConfig>;
|
|
123
|
+
}>;
|
|
124
|
+
/**
|
|
125
|
+
* JWT authentication configuration for client-side signing
|
|
126
|
+
*/
|
|
127
|
+
export type ClientJwtAuth = {
|
|
128
|
+
/**
|
|
129
|
+
* JWT key configuration (encoding key for signing)
|
|
130
|
+
*/ key: JwtKeyType;
|
|
131
|
+
/**
|
|
132
|
+
* JWT audience claims to include
|
|
133
|
+
*/ audience?: Array<string>;
|
|
134
|
+
/**
|
|
135
|
+
* JWT issuer to include
|
|
136
|
+
*/ issuer?: string;
|
|
137
|
+
/**
|
|
138
|
+
* JWT subject to include
|
|
139
|
+
*/ subject?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Token validity duration (default: 3600 seconds)
|
|
142
|
+
*/ duration: number;
|
|
143
|
+
};
|
|
144
|
+
export declare const ClientJwtAuth: Readonly<{
|
|
145
|
+
/**
|
|
146
|
+
* Create a frozen instance of {@link ClientJwtAuth}, with defaults specified
|
|
147
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
148
|
+
*/
|
|
149
|
+
create: any;
|
|
150
|
+
/**
|
|
151
|
+
* Create a frozen instance of {@link ClientJwtAuth}, with defaults specified
|
|
152
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
153
|
+
*/
|
|
154
|
+
new: any;
|
|
155
|
+
/**
|
|
156
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
157
|
+
*/
|
|
158
|
+
defaults: () => Partial<ClientJwtAuth>;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* DataPlane configuration wrapper for uniffi bindings
|
|
162
|
+
*/
|
|
163
|
+
export type DataplaneConfig = {
|
|
164
|
+
/**
|
|
165
|
+
* DataPlane GRPC server settings
|
|
166
|
+
*/ servers: Array<ServerConfig>;
|
|
167
|
+
/**
|
|
168
|
+
* DataPlane client configs
|
|
169
|
+
*/ clients: Array<ClientConfig>;
|
|
170
|
+
};
|
|
171
|
+
export declare const DataplaneConfig: Readonly<{
|
|
172
|
+
/**
|
|
173
|
+
* Create a frozen instance of {@link DataplaneConfig}, with defaults specified
|
|
174
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
175
|
+
*/
|
|
176
|
+
create: any;
|
|
177
|
+
/**
|
|
178
|
+
* Create a frozen instance of {@link DataplaneConfig}, with defaults specified
|
|
179
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
180
|
+
*/
|
|
181
|
+
new: any;
|
|
182
|
+
/**
|
|
183
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
184
|
+
*/
|
|
185
|
+
defaults: () => Partial<DataplaneConfig>;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Exponential backoff configuration
|
|
189
|
+
*/
|
|
190
|
+
export type ExponentialBackoff = {
|
|
191
|
+
/**
|
|
192
|
+
* Base delay
|
|
193
|
+
*/ base: number;
|
|
194
|
+
/**
|
|
195
|
+
* Multiplication factor for each retry
|
|
196
|
+
*/ factor: bigint;
|
|
197
|
+
/**
|
|
198
|
+
* Maximum delay
|
|
199
|
+
*/ maxDelay: number;
|
|
200
|
+
/**
|
|
201
|
+
* Maximum number of retry attempts
|
|
202
|
+
*/ maxAttempts: bigint;
|
|
203
|
+
/**
|
|
204
|
+
* Whether to add random jitter to delays
|
|
205
|
+
*/ jitter: boolean;
|
|
206
|
+
};
|
|
207
|
+
export declare const ExponentialBackoff: Readonly<{
|
|
208
|
+
/**
|
|
209
|
+
* Create a frozen instance of {@link ExponentialBackoff}, with defaults specified
|
|
210
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
211
|
+
*/
|
|
212
|
+
create: any;
|
|
213
|
+
/**
|
|
214
|
+
* Create a frozen instance of {@link ExponentialBackoff}, with defaults specified
|
|
215
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
216
|
+
*/
|
|
217
|
+
new: any;
|
|
218
|
+
/**
|
|
219
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
220
|
+
*/
|
|
221
|
+
defaults: () => Partial<ExponentialBackoff>;
|
|
222
|
+
}>;
|
|
223
|
+
/**
|
|
224
|
+
* Fixed interval backoff configuration
|
|
225
|
+
*/
|
|
226
|
+
export type FixedIntervalBackoff = {
|
|
227
|
+
/**
|
|
228
|
+
* Fixed interval between retries
|
|
229
|
+
*/ interval: number;
|
|
230
|
+
/**
|
|
231
|
+
* Maximum number of retry attempts
|
|
232
|
+
*/ maxAttempts: bigint;
|
|
233
|
+
};
|
|
234
|
+
export declare const FixedIntervalBackoff: Readonly<{
|
|
235
|
+
/**
|
|
236
|
+
* Create a frozen instance of {@link FixedIntervalBackoff}, with defaults specified
|
|
237
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
238
|
+
*/
|
|
239
|
+
create: any;
|
|
240
|
+
/**
|
|
241
|
+
* Create a frozen instance of {@link FixedIntervalBackoff}, with defaults specified
|
|
242
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
243
|
+
*/
|
|
244
|
+
new: any;
|
|
245
|
+
/**
|
|
246
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
247
|
+
*/
|
|
248
|
+
defaults: () => Partial<FixedIntervalBackoff>;
|
|
249
|
+
}>;
|
|
250
|
+
/**
|
|
251
|
+
* JWT authentication configuration for server-side verification
|
|
252
|
+
*/
|
|
253
|
+
export type JwtAuth = {
|
|
254
|
+
/**
|
|
255
|
+
* JWT key configuration (decoding key for verification)
|
|
256
|
+
*/ key: JwtKeyType;
|
|
257
|
+
/**
|
|
258
|
+
* JWT audience claims to verify
|
|
259
|
+
*/ audience?: Array<string>;
|
|
260
|
+
/**
|
|
261
|
+
* JWT issuer to verify
|
|
262
|
+
*/ issuer?: string;
|
|
263
|
+
/**
|
|
264
|
+
* JWT subject to verify
|
|
265
|
+
*/ subject?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Token validity duration (default: 3600 seconds)
|
|
268
|
+
*/ duration: number;
|
|
269
|
+
};
|
|
270
|
+
export declare const JwtAuth: Readonly<{
|
|
271
|
+
/**
|
|
272
|
+
* Create a frozen instance of {@link JwtAuth}, with defaults specified
|
|
273
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
274
|
+
*/
|
|
275
|
+
create: any;
|
|
276
|
+
/**
|
|
277
|
+
* Create a frozen instance of {@link JwtAuth}, with defaults specified
|
|
278
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
279
|
+
*/
|
|
280
|
+
new: any;
|
|
281
|
+
/**
|
|
282
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
283
|
+
*/
|
|
284
|
+
defaults: () => Partial<JwtAuth>;
|
|
285
|
+
}>;
|
|
286
|
+
/**
|
|
287
|
+
* JWT key configuration
|
|
288
|
+
*/
|
|
289
|
+
export type JwtKeyConfig = {
|
|
290
|
+
/**
|
|
291
|
+
* Algorithm used for signing/verifying the JWT
|
|
292
|
+
*/ algorithm: JwtAlgorithm;
|
|
293
|
+
/**
|
|
294
|
+
* Key format - PEM, JWK or JWKS
|
|
295
|
+
*/ format: JwtKeyFormat;
|
|
296
|
+
/**
|
|
297
|
+
* Encoded key or file path
|
|
298
|
+
*/ key: JwtKeyData;
|
|
299
|
+
};
|
|
300
|
+
export declare const JwtKeyConfig: Readonly<{
|
|
301
|
+
/**
|
|
302
|
+
* Create a frozen instance of {@link JwtKeyConfig}, with defaults specified
|
|
303
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
304
|
+
*/
|
|
305
|
+
create: any;
|
|
306
|
+
/**
|
|
307
|
+
* Create a frozen instance of {@link JwtKeyConfig}, with defaults specified
|
|
308
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
309
|
+
*/
|
|
310
|
+
new: any;
|
|
311
|
+
/**
|
|
312
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
313
|
+
*/
|
|
314
|
+
defaults: () => Partial<JwtKeyConfig>;
|
|
315
|
+
}>;
|
|
316
|
+
/**
|
|
317
|
+
* Keepalive configuration for the client
|
|
318
|
+
*/
|
|
319
|
+
export type KeepaliveConfig = {
|
|
320
|
+
/**
|
|
321
|
+
* TCP keepalive duration
|
|
322
|
+
*/ tcpKeepalive: number;
|
|
323
|
+
/**
|
|
324
|
+
* HTTP2 keepalive duration
|
|
325
|
+
*/ http2Keepalive: number;
|
|
326
|
+
/**
|
|
327
|
+
* Keepalive timeout
|
|
328
|
+
*/ timeout: number;
|
|
329
|
+
/**
|
|
330
|
+
* Whether to permit keepalive without an active stream
|
|
331
|
+
*/ keepAliveWhileIdle: boolean;
|
|
332
|
+
};
|
|
333
|
+
export declare const KeepaliveConfig: Readonly<{
|
|
334
|
+
/**
|
|
335
|
+
* Create a frozen instance of {@link KeepaliveConfig}, with defaults specified
|
|
336
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
337
|
+
*/
|
|
338
|
+
create: any;
|
|
339
|
+
/**
|
|
340
|
+
* Create a frozen instance of {@link KeepaliveConfig}, with defaults specified
|
|
341
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
342
|
+
*/
|
|
343
|
+
new: any;
|
|
344
|
+
/**
|
|
345
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
346
|
+
*/
|
|
347
|
+
defaults: () => Partial<KeepaliveConfig>;
|
|
348
|
+
}>;
|
|
349
|
+
/**
|
|
350
|
+
* Keepalive configuration for the server
|
|
351
|
+
*/
|
|
352
|
+
export type KeepaliveServerParameters = {
|
|
353
|
+
/**
|
|
354
|
+
* Max connection idle time (time after which an idle connection is closed)
|
|
355
|
+
*/ maxConnectionIdle: number;
|
|
356
|
+
/**
|
|
357
|
+
* Max connection age (maximum time a connection may exist before being closed)
|
|
358
|
+
*/ maxConnectionAge: number;
|
|
359
|
+
/**
|
|
360
|
+
* Max connection age grace (additional time after max_connection_age before closing)
|
|
361
|
+
*/ maxConnectionAgeGrace: number;
|
|
362
|
+
/**
|
|
363
|
+
* Keepalive ping frequency
|
|
364
|
+
*/ time: number;
|
|
365
|
+
/**
|
|
366
|
+
* Keepalive ping timeout (time to wait for ack)
|
|
367
|
+
*/ timeout: number;
|
|
368
|
+
};
|
|
369
|
+
export declare const KeepaliveServerParameters: Readonly<{
|
|
370
|
+
/**
|
|
371
|
+
* Create a frozen instance of {@link KeepaliveServerParameters}, with defaults specified
|
|
372
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
373
|
+
*/
|
|
374
|
+
create: any;
|
|
375
|
+
/**
|
|
376
|
+
* Create a frozen instance of {@link KeepaliveServerParameters}, with defaults specified
|
|
377
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
378
|
+
*/
|
|
379
|
+
new: any;
|
|
380
|
+
/**
|
|
381
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
382
|
+
*/
|
|
383
|
+
defaults: () => Partial<KeepaliveServerParameters>;
|
|
384
|
+
}>;
|
|
385
|
+
/**
|
|
386
|
+
* Generic message context for language bindings (UniFFI-compatible)
|
|
387
|
+
*
|
|
388
|
+
* Provides routing and descriptive metadata needed for replying,
|
|
389
|
+
* auditing, and instrumentation across different language bindings.
|
|
390
|
+
* This type is exported to foreign languages via UniFFI.
|
|
391
|
+
*/
|
|
392
|
+
export type MessageContext = {
|
|
393
|
+
/**
|
|
394
|
+
* Fully-qualified sender identity
|
|
395
|
+
*/ sourceName: Name;
|
|
396
|
+
/**
|
|
397
|
+
* Fully-qualified destination identity (may be empty for broadcast/group scenarios)
|
|
398
|
+
*/ destinationName?: Name;
|
|
399
|
+
/**
|
|
400
|
+
* Logical/semantic type (defaults to "msg" if unspecified)
|
|
401
|
+
*/ payloadType: string;
|
|
402
|
+
/**
|
|
403
|
+
* Arbitrary key/value pairs supplied by the sender (e.g. tracing IDs)
|
|
404
|
+
*/ metadata: Map<string, string>;
|
|
405
|
+
/**
|
|
406
|
+
* Numeric identifier of the inbound connection carrying the message
|
|
407
|
+
*/ inputConnection: bigint;
|
|
408
|
+
/**
|
|
409
|
+
* Identity contained in the message
|
|
410
|
+
*/ identity: string;
|
|
411
|
+
};
|
|
412
|
+
export declare const MessageContext: Readonly<{
|
|
413
|
+
/**
|
|
414
|
+
* Create a frozen instance of {@link MessageContext}, with defaults specified
|
|
415
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
416
|
+
*/
|
|
417
|
+
create: any;
|
|
418
|
+
/**
|
|
419
|
+
* Create a frozen instance of {@link MessageContext}, with defaults specified
|
|
420
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
421
|
+
*/
|
|
422
|
+
new: any;
|
|
423
|
+
/**
|
|
424
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
425
|
+
*/
|
|
426
|
+
defaults: () => Partial<MessageContext>;
|
|
427
|
+
}>;
|
|
428
|
+
/**
|
|
429
|
+
* HTTP Proxy configuration
|
|
430
|
+
*/
|
|
431
|
+
export type ProxyConfig = {
|
|
432
|
+
/**
|
|
433
|
+
* The HTTP proxy URL (e.g., "http://proxy.example.com:8080")
|
|
434
|
+
*/ url?: string;
|
|
435
|
+
/**
|
|
436
|
+
* TLS configuration for proxy connection
|
|
437
|
+
*/ tls: TlsClientConfig;
|
|
438
|
+
/**
|
|
439
|
+
* Optional username for proxy authentication
|
|
440
|
+
*/ username?: string;
|
|
441
|
+
/**
|
|
442
|
+
* Optional password for proxy authentication
|
|
443
|
+
*/ password?: string;
|
|
444
|
+
/**
|
|
445
|
+
* Headers to send with proxy requests
|
|
446
|
+
*/ headers: Map<string, string>;
|
|
447
|
+
};
|
|
448
|
+
export declare const ProxyConfig: Readonly<{
|
|
449
|
+
/**
|
|
450
|
+
* Create a frozen instance of {@link ProxyConfig}, with defaults specified
|
|
451
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
452
|
+
*/
|
|
453
|
+
create: any;
|
|
454
|
+
/**
|
|
455
|
+
* Create a frozen instance of {@link ProxyConfig}, with defaults specified
|
|
456
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
457
|
+
*/
|
|
458
|
+
new: any;
|
|
459
|
+
/**
|
|
460
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
461
|
+
*/
|
|
462
|
+
defaults: () => Partial<ProxyConfig>;
|
|
463
|
+
}>;
|
|
464
|
+
/**
|
|
465
|
+
* Received message containing context and payload
|
|
466
|
+
*/
|
|
467
|
+
export type ReceivedMessage = {
|
|
468
|
+
context: MessageContext;
|
|
469
|
+
payload: ArrayBuffer;
|
|
470
|
+
};
|
|
471
|
+
export declare const ReceivedMessage: Readonly<{
|
|
472
|
+
/**
|
|
473
|
+
* Create a frozen instance of {@link ReceivedMessage}, with defaults specified
|
|
474
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
475
|
+
*/
|
|
476
|
+
create: any;
|
|
477
|
+
/**
|
|
478
|
+
* Create a frozen instance of {@link ReceivedMessage}, with defaults specified
|
|
479
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
480
|
+
*/
|
|
481
|
+
new: any;
|
|
482
|
+
/**
|
|
483
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
484
|
+
*/
|
|
485
|
+
defaults: () => Partial<ReceivedMessage>;
|
|
486
|
+
}>;
|
|
487
|
+
/**
|
|
488
|
+
* Runtime configuration for the SLIM bindings
|
|
489
|
+
*
|
|
490
|
+
* Controls the Tokio runtime behavior including thread count, naming, and shutdown timeout.
|
|
491
|
+
*/
|
|
492
|
+
export type RuntimeConfig = {
|
|
493
|
+
/**
|
|
494
|
+
* Number of cores to use for the runtime (0 = use all available cores)
|
|
495
|
+
*/ nCores: bigint;
|
|
496
|
+
/**
|
|
497
|
+
* Thread name prefix for the runtime
|
|
498
|
+
*/ threadName: string;
|
|
499
|
+
/**
|
|
500
|
+
* Timeout duration for draining services during shutdown
|
|
501
|
+
*/ drainTimeout: number;
|
|
502
|
+
};
|
|
503
|
+
export declare const RuntimeConfig: Readonly<{
|
|
504
|
+
/**
|
|
505
|
+
* Create a frozen instance of {@link RuntimeConfig}, with defaults specified
|
|
506
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
507
|
+
*/
|
|
508
|
+
create: any;
|
|
509
|
+
/**
|
|
510
|
+
* Create a frozen instance of {@link RuntimeConfig}, with defaults specified
|
|
511
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
512
|
+
*/
|
|
513
|
+
new: any;
|
|
514
|
+
/**
|
|
515
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
516
|
+
*/
|
|
517
|
+
defaults: () => Partial<RuntimeConfig>;
|
|
518
|
+
}>;
|
|
519
|
+
/**
|
|
520
|
+
* Server configuration for running a SLIM server
|
|
521
|
+
*/
|
|
522
|
+
export type ServerConfig = {
|
|
523
|
+
/**
|
|
524
|
+
* Endpoint address to listen on (e.g., "0.0.0.0:50051" or "[::]:50051")
|
|
525
|
+
*/ endpoint: string;
|
|
526
|
+
/**
|
|
527
|
+
* TLS server configuration
|
|
528
|
+
*/ tls: TlsServerConfig;
|
|
529
|
+
/**
|
|
530
|
+
* Use HTTP/2 only (default: true)
|
|
531
|
+
*/ http2Only: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Maximum size (in MiB) of messages accepted by the server
|
|
534
|
+
*/ maxFrameSize?: number;
|
|
535
|
+
/**
|
|
536
|
+
* Maximum number of concurrent streams per connection
|
|
537
|
+
*/ maxConcurrentStreams?: number;
|
|
538
|
+
/**
|
|
539
|
+
* Maximum header list size in bytes
|
|
540
|
+
*/ maxHeaderListSize?: number;
|
|
541
|
+
/**
|
|
542
|
+
* Read buffer size in bytes
|
|
543
|
+
*/ readBufferSize?: bigint;
|
|
544
|
+
/**
|
|
545
|
+
* Write buffer size in bytes
|
|
546
|
+
*/ writeBufferSize?: bigint;
|
|
547
|
+
/**
|
|
548
|
+
* Keepalive parameters
|
|
549
|
+
*/ keepalive: KeepaliveServerParameters;
|
|
550
|
+
/**
|
|
551
|
+
* Authentication configuration for incoming requests
|
|
552
|
+
*/ auth: ServerAuthenticationConfig;
|
|
553
|
+
/**
|
|
554
|
+
* Arbitrary user-provided metadata as JSON string
|
|
555
|
+
*/ metadata?: string;
|
|
556
|
+
};
|
|
557
|
+
export declare const ServerConfig: Readonly<{
|
|
558
|
+
/**
|
|
559
|
+
* Create a frozen instance of {@link ServerConfig}, with defaults specified
|
|
560
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
561
|
+
*/
|
|
562
|
+
create: any;
|
|
563
|
+
/**
|
|
564
|
+
* Create a frozen instance of {@link ServerConfig}, with defaults specified
|
|
565
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
566
|
+
*/
|
|
567
|
+
new: any;
|
|
568
|
+
/**
|
|
569
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
570
|
+
*/
|
|
571
|
+
defaults: () => Partial<ServerConfig>;
|
|
572
|
+
}>;
|
|
573
|
+
/**
|
|
574
|
+
* Service configuration wrapper for uniffi bindings
|
|
575
|
+
*/
|
|
576
|
+
export type ServiceConfig = {
|
|
577
|
+
/**
|
|
578
|
+
* Optional node ID for the service
|
|
579
|
+
*/ nodeId?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Optional group name for the service
|
|
582
|
+
*/ groupName?: string;
|
|
583
|
+
/**
|
|
584
|
+
* DataPlane configuration (servers and clients)
|
|
585
|
+
*/ dataplane: DataplaneConfig;
|
|
586
|
+
};
|
|
587
|
+
export declare const ServiceConfig: Readonly<{
|
|
588
|
+
/**
|
|
589
|
+
* Create a frozen instance of {@link ServiceConfig}, with defaults specified
|
|
590
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
591
|
+
*/
|
|
592
|
+
create: any;
|
|
593
|
+
/**
|
|
594
|
+
* Create a frozen instance of {@link ServiceConfig}, with defaults specified
|
|
595
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
596
|
+
*/
|
|
597
|
+
new: any;
|
|
598
|
+
/**
|
|
599
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
600
|
+
*/
|
|
601
|
+
defaults: () => Partial<ServiceConfig>;
|
|
602
|
+
}>;
|
|
603
|
+
/**
|
|
604
|
+
* Session configuration
|
|
605
|
+
*/
|
|
606
|
+
export type SessionConfig = {
|
|
607
|
+
/**
|
|
608
|
+
* Session type (PointToPoint or Group)
|
|
609
|
+
*/ sessionType: SessionType;
|
|
610
|
+
/**
|
|
611
|
+
* Enable MLS encryption for this session
|
|
612
|
+
*/ enableMls: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* Maximum number of retries for message transmission (None = use default)
|
|
615
|
+
*/ maxRetries?: number;
|
|
616
|
+
/**
|
|
617
|
+
* Interval between retries in milliseconds (None = use default)
|
|
618
|
+
*/ interval?: number;
|
|
619
|
+
/**
|
|
620
|
+
* Custom metadata key-value pairs for the session
|
|
621
|
+
*/ metadata: Map<string, string>;
|
|
622
|
+
};
|
|
623
|
+
export declare const SessionConfig: Readonly<{
|
|
624
|
+
/**
|
|
625
|
+
* Create a frozen instance of {@link SessionConfig}, with defaults specified
|
|
626
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
627
|
+
*/
|
|
628
|
+
create: any;
|
|
629
|
+
/**
|
|
630
|
+
* Create a frozen instance of {@link SessionConfig}, with defaults specified
|
|
631
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
632
|
+
*/
|
|
633
|
+
new: any;
|
|
634
|
+
/**
|
|
635
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
636
|
+
*/
|
|
637
|
+
defaults: () => Partial<SessionConfig>;
|
|
638
|
+
}>;
|
|
639
|
+
/**
|
|
640
|
+
* Result of creating a session, containing the session context and a completion handle
|
|
641
|
+
*
|
|
642
|
+
* The completion handle should be awaited to ensure the session is fully established.
|
|
643
|
+
*/
|
|
644
|
+
export type SessionWithCompletion = {
|
|
645
|
+
/**
|
|
646
|
+
* The session context for performing operations
|
|
647
|
+
*/ session: Session;
|
|
648
|
+
/**
|
|
649
|
+
* Completion handle to wait for session establishment
|
|
650
|
+
*/ completion: CompletionHandle;
|
|
651
|
+
};
|
|
652
|
+
export declare const SessionWithCompletion: Readonly<{
|
|
653
|
+
/**
|
|
654
|
+
* Create a frozen instance of {@link SessionWithCompletion}, with defaults specified
|
|
655
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
656
|
+
*/
|
|
657
|
+
create: any;
|
|
658
|
+
/**
|
|
659
|
+
* Create a frozen instance of {@link SessionWithCompletion}, with defaults specified
|
|
660
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
661
|
+
*/
|
|
662
|
+
new: any;
|
|
663
|
+
/**
|
|
664
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
665
|
+
*/
|
|
666
|
+
defaults: () => Partial<SessionWithCompletion>;
|
|
667
|
+
}>;
|
|
668
|
+
/**
|
|
669
|
+
* SPIRE configuration for SPIFFE Workload API integration
|
|
670
|
+
*/
|
|
671
|
+
export type SpireConfig = {
|
|
672
|
+
/**
|
|
673
|
+
* Path to the SPIFFE Workload API socket (None => use SPIFFE_ENDPOINT_SOCKET env var)
|
|
674
|
+
*/ socketPath?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Optional target SPIFFE ID when requesting JWT SVIDs
|
|
677
|
+
*/ targetSpiffeId?: string;
|
|
678
|
+
/**
|
|
679
|
+
* Audiences to request/verify for JWT SVIDs
|
|
680
|
+
*/ jwtAudiences: Array<string>;
|
|
681
|
+
/**
|
|
682
|
+
* Optional trust domains override for X.509 bundle retrieval
|
|
683
|
+
*/ trustDomains: Array<string>;
|
|
684
|
+
};
|
|
685
|
+
export declare const SpireConfig: Readonly<{
|
|
686
|
+
/**
|
|
687
|
+
* Create a frozen instance of {@link SpireConfig}, with defaults specified
|
|
688
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
689
|
+
*/
|
|
690
|
+
create: any;
|
|
691
|
+
/**
|
|
692
|
+
* Create a frozen instance of {@link SpireConfig}, with defaults specified
|
|
693
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
694
|
+
*/
|
|
695
|
+
new: any;
|
|
696
|
+
/**
|
|
697
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
698
|
+
*/
|
|
699
|
+
defaults: () => Partial<SpireConfig>;
|
|
700
|
+
}>;
|
|
701
|
+
/**
|
|
702
|
+
* Static JWT (Bearer token) authentication configuration
|
|
703
|
+
* The token is loaded from a file and automatically reloaded when changed
|
|
704
|
+
*/
|
|
705
|
+
export type StaticJwtAuth = {
|
|
706
|
+
/**
|
|
707
|
+
* Path to file containing the JWT token
|
|
708
|
+
*/ tokenFile: string;
|
|
709
|
+
/**
|
|
710
|
+
* Duration for caching the token before re-reading from file (default: 3600 seconds)
|
|
711
|
+
*/ duration: number;
|
|
712
|
+
};
|
|
713
|
+
export declare const StaticJwtAuth: Readonly<{
|
|
714
|
+
/**
|
|
715
|
+
* Create a frozen instance of {@link StaticJwtAuth}, with defaults specified
|
|
716
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
717
|
+
*/
|
|
718
|
+
create: any;
|
|
719
|
+
/**
|
|
720
|
+
* Create a frozen instance of {@link StaticJwtAuth}, with defaults specified
|
|
721
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
722
|
+
*/
|
|
723
|
+
new: any;
|
|
724
|
+
/**
|
|
725
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
726
|
+
*/
|
|
727
|
+
defaults: () => Partial<StaticJwtAuth>;
|
|
728
|
+
}>;
|
|
729
|
+
/**
|
|
730
|
+
* TLS configuration for client connections
|
|
731
|
+
*/
|
|
732
|
+
export type TlsClientConfig = {
|
|
733
|
+
/**
|
|
734
|
+
* Disable TLS entirely (plain text connection)
|
|
735
|
+
*/ insecure: boolean;
|
|
736
|
+
/**
|
|
737
|
+
* Skip server certificate verification (enables TLS but doesn't verify certs)
|
|
738
|
+
* WARNING: Only use for testing - insecure in production!
|
|
739
|
+
*/ insecureSkipVerify: boolean;
|
|
740
|
+
/**
|
|
741
|
+
* Certificate and key source for client authentication
|
|
742
|
+
*/ source: TlsSource;
|
|
743
|
+
/**
|
|
744
|
+
* CA certificate source for verifying server certificates
|
|
745
|
+
*/ caSource: CaSource;
|
|
746
|
+
/**
|
|
747
|
+
* Include system CA certificates pool (default: true)
|
|
748
|
+
*/ includeSystemCaCertsPool: boolean;
|
|
749
|
+
/**
|
|
750
|
+
* TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3")
|
|
751
|
+
*/ tlsVersion: string;
|
|
752
|
+
};
|
|
753
|
+
export declare const TlsClientConfig: Readonly<{
|
|
754
|
+
/**
|
|
755
|
+
* Create a frozen instance of {@link TlsClientConfig}, with defaults specified
|
|
756
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
757
|
+
*/
|
|
758
|
+
create: any;
|
|
759
|
+
/**
|
|
760
|
+
* Create a frozen instance of {@link TlsClientConfig}, with defaults specified
|
|
761
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
762
|
+
*/
|
|
763
|
+
new: any;
|
|
764
|
+
/**
|
|
765
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
766
|
+
*/
|
|
767
|
+
defaults: () => Partial<TlsClientConfig>;
|
|
768
|
+
}>;
|
|
769
|
+
/**
|
|
770
|
+
* TLS configuration for server connections
|
|
771
|
+
*/
|
|
772
|
+
export type TlsServerConfig = {
|
|
773
|
+
/**
|
|
774
|
+
* Disable TLS entirely (plain text connection)
|
|
775
|
+
*/ insecure: boolean;
|
|
776
|
+
/**
|
|
777
|
+
* Certificate and key source for server authentication
|
|
778
|
+
*/ source: TlsSource;
|
|
779
|
+
/**
|
|
780
|
+
* CA certificate source for verifying client certificates
|
|
781
|
+
*/ clientCa: CaSource;
|
|
782
|
+
/**
|
|
783
|
+
* Include system CA certificates pool (default: true)
|
|
784
|
+
*/ includeSystemCaCertsPool: boolean;
|
|
785
|
+
/**
|
|
786
|
+
* TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3")
|
|
787
|
+
*/ tlsVersion: string;
|
|
788
|
+
/**
|
|
789
|
+
* Reload client CA file when modified
|
|
790
|
+
*/ reloadClientCaFile: boolean;
|
|
791
|
+
};
|
|
792
|
+
export declare const TlsServerConfig: Readonly<{
|
|
793
|
+
/**
|
|
794
|
+
* Create a frozen instance of {@link TlsServerConfig}, with defaults specified
|
|
795
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
796
|
+
*/
|
|
797
|
+
create: any;
|
|
798
|
+
/**
|
|
799
|
+
* Create a frozen instance of {@link TlsServerConfig}, with defaults specified
|
|
800
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
801
|
+
*/
|
|
802
|
+
new: any;
|
|
803
|
+
/**
|
|
804
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
805
|
+
*/
|
|
806
|
+
defaults: () => Partial<TlsServerConfig>;
|
|
807
|
+
}>;
|
|
808
|
+
/**
|
|
809
|
+
* Tracing/logging configuration for the SLIM bindings
|
|
810
|
+
*
|
|
811
|
+
* Controls logging behavior including log level, thread name/ID display, and filters.
|
|
812
|
+
*/
|
|
813
|
+
export type TracingConfig = {
|
|
814
|
+
/**
|
|
815
|
+
* Log level (e.g., "debug", "info", "warn", "error")
|
|
816
|
+
*/ logLevel: string;
|
|
817
|
+
/**
|
|
818
|
+
* Whether to display thread names in logs
|
|
819
|
+
*/ displayThreadNames: boolean;
|
|
820
|
+
/**
|
|
821
|
+
* Whether to display thread IDs in logs
|
|
822
|
+
*/ displayThreadIds: boolean;
|
|
823
|
+
/**
|
|
824
|
+
* List of tracing filter directives (e.g., ["slim=debug", "tokio=info"])
|
|
825
|
+
*/ filters: Array<string>;
|
|
826
|
+
};
|
|
827
|
+
export declare const TracingConfig: Readonly<{
|
|
828
|
+
/**
|
|
829
|
+
* Create a frozen instance of {@link TracingConfig}, with defaults specified
|
|
830
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
831
|
+
*/
|
|
832
|
+
create: any;
|
|
833
|
+
/**
|
|
834
|
+
* Create a frozen instance of {@link TracingConfig}, with defaults specified
|
|
835
|
+
* in Rust, in the {@link slim_bindings} crate.
|
|
836
|
+
*/
|
|
837
|
+
new: any;
|
|
838
|
+
/**
|
|
839
|
+
* Defaults specified in the {@link slim_bindings} crate.
|
|
840
|
+
*/
|
|
841
|
+
defaults: () => Partial<TracingConfig>;
|
|
842
|
+
}>;
|
|
843
|
+
/**
|
|
844
|
+
* Backoff retry configuration
|
|
845
|
+
*/
|
|
846
|
+
export type BackoffConfig = {
|
|
847
|
+
tag: "exponential";
|
|
848
|
+
inner: Readonly<{
|
|
849
|
+
config: ExponentialBackoff;
|
|
850
|
+
}>;
|
|
851
|
+
} | {
|
|
852
|
+
tag: "fixedInterval";
|
|
853
|
+
inner: Readonly<{
|
|
854
|
+
config: FixedIntervalBackoff;
|
|
855
|
+
}>;
|
|
856
|
+
};
|
|
857
|
+
export declare const FfiConverterTypeBackoffConfig: {
|
|
858
|
+
read(from: RustBuffer): BackoffConfig;
|
|
859
|
+
write(value: BackoffConfig, into: RustBuffer): void;
|
|
860
|
+
allocationSize(value: BackoffConfig): number;
|
|
861
|
+
};
|
|
862
|
+
/**
|
|
863
|
+
* CA certificate source configuration
|
|
864
|
+
*/
|
|
865
|
+
export type CaSource =
|
|
866
|
+
/**
|
|
867
|
+
* Load CA from file
|
|
868
|
+
*/
|
|
869
|
+
{
|
|
870
|
+
tag: "file";
|
|
871
|
+
inner: Readonly<{
|
|
872
|
+
path: string;
|
|
873
|
+
}>;
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Load CA from PEM string
|
|
877
|
+
*/
|
|
878
|
+
| {
|
|
879
|
+
tag: "pem";
|
|
880
|
+
inner: Readonly<{
|
|
881
|
+
data: string;
|
|
882
|
+
}>;
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Load CA from SPIRE Workload API
|
|
886
|
+
*/
|
|
887
|
+
| {
|
|
888
|
+
tag: "spire";
|
|
889
|
+
inner: Readonly<{
|
|
890
|
+
config: SpireConfig;
|
|
891
|
+
}>;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* No CA configured
|
|
895
|
+
*/
|
|
896
|
+
| {
|
|
897
|
+
tag: "none";
|
|
898
|
+
};
|
|
899
|
+
export declare const FfiConverterTypeCaSource: {
|
|
900
|
+
read(from: RustBuffer): CaSource;
|
|
901
|
+
write(value: CaSource, into: RustBuffer): void;
|
|
902
|
+
allocationSize(value: CaSource): number;
|
|
903
|
+
};
|
|
904
|
+
/**
|
|
905
|
+
* Authentication configuration enum for client
|
|
906
|
+
*/
|
|
907
|
+
export type ClientAuthenticationConfig = {
|
|
908
|
+
tag: "basic";
|
|
909
|
+
inner: Readonly<{
|
|
910
|
+
config: BasicAuth;
|
|
911
|
+
}>;
|
|
912
|
+
} | {
|
|
913
|
+
tag: "staticJwt";
|
|
914
|
+
inner: Readonly<{
|
|
915
|
+
config: StaticJwtAuth;
|
|
916
|
+
}>;
|
|
917
|
+
} | {
|
|
918
|
+
tag: "jwt";
|
|
919
|
+
inner: Readonly<{
|
|
920
|
+
config: ClientJwtAuth;
|
|
921
|
+
}>;
|
|
922
|
+
} | {
|
|
923
|
+
tag: "none";
|
|
924
|
+
};
|
|
925
|
+
export declare const FfiConverterTypeClientAuthenticationConfig: {
|
|
926
|
+
read(from: RustBuffer): ClientAuthenticationConfig;
|
|
927
|
+
write(value: ClientAuthenticationConfig, into: RustBuffer): void;
|
|
928
|
+
allocationSize(value: ClientAuthenticationConfig): number;
|
|
929
|
+
};
|
|
930
|
+
/**
|
|
931
|
+
* gRPC status codes
|
|
932
|
+
*/
|
|
933
|
+
export type Code =
|
|
934
|
+
/**
|
|
935
|
+
* Success
|
|
936
|
+
*/
|
|
937
|
+
"ok"
|
|
938
|
+
/**
|
|
939
|
+
* The operation was cancelled
|
|
940
|
+
*/
|
|
941
|
+
| "cancelled"
|
|
942
|
+
/**
|
|
943
|
+
* Unknown error
|
|
944
|
+
*/
|
|
945
|
+
| "unknown"
|
|
946
|
+
/**
|
|
947
|
+
* Client specified an invalid argument
|
|
948
|
+
*/
|
|
949
|
+
| "invalidArgument"
|
|
950
|
+
/**
|
|
951
|
+
* Deadline expired before operation could complete
|
|
952
|
+
*/
|
|
953
|
+
| "deadlineExceeded"
|
|
954
|
+
/**
|
|
955
|
+
* Some requested entity was not found
|
|
956
|
+
*/
|
|
957
|
+
| "notFound"
|
|
958
|
+
/**
|
|
959
|
+
* Some entity that we attempted to create already exists
|
|
960
|
+
*/
|
|
961
|
+
| "alreadyExists"
|
|
962
|
+
/**
|
|
963
|
+
* The caller does not have permission to execute the specified operation
|
|
964
|
+
*/
|
|
965
|
+
| "permissionDenied"
|
|
966
|
+
/**
|
|
967
|
+
* Some resource has been exhausted
|
|
968
|
+
*/
|
|
969
|
+
| "resourceExhausted"
|
|
970
|
+
/**
|
|
971
|
+
* The system is not in a state required for the operation's execution
|
|
972
|
+
*/
|
|
973
|
+
| "failedPrecondition"
|
|
974
|
+
/**
|
|
975
|
+
* The operation was aborted
|
|
976
|
+
*/
|
|
977
|
+
| "aborted"
|
|
978
|
+
/**
|
|
979
|
+
* Operation was attempted past the valid range
|
|
980
|
+
*/
|
|
981
|
+
| "outOfRange"
|
|
982
|
+
/**
|
|
983
|
+
* Operation is not implemented or not supported
|
|
984
|
+
*/
|
|
985
|
+
| "unimplemented"
|
|
986
|
+
/**
|
|
987
|
+
* Internal errors
|
|
988
|
+
*/
|
|
989
|
+
| "internal"
|
|
990
|
+
/**
|
|
991
|
+
* The service is currently unavailable
|
|
992
|
+
*/
|
|
993
|
+
| "unavailable"
|
|
994
|
+
/**
|
|
995
|
+
* Unrecoverable data loss or corruption
|
|
996
|
+
*/
|
|
997
|
+
| "dataLoss"
|
|
998
|
+
/**
|
|
999
|
+
* The request does not have valid authentication credentials
|
|
1000
|
+
*/
|
|
1001
|
+
| "unauthenticated";
|
|
1002
|
+
export declare const FfiConverterTypeCode: {
|
|
1003
|
+
read(from: RustBuffer): Code;
|
|
1004
|
+
write(value: Code, into: RustBuffer): void;
|
|
1005
|
+
allocationSize(value: Code): number;
|
|
1006
|
+
};
|
|
1007
|
+
/**
|
|
1008
|
+
* Compression type for gRPC messages
|
|
1009
|
+
*/
|
|
1010
|
+
export type CompressionType = "gzip" | "zlib" | "deflate" | "snappy" | "zstd" | "lz4" | "none" | "empty";
|
|
1011
|
+
export declare const FfiConverterTypeCompressionType: {
|
|
1012
|
+
read(from: RustBuffer): CompressionType;
|
|
1013
|
+
write(value: CompressionType, into: RustBuffer): void;
|
|
1014
|
+
allocationSize(value: CompressionType): number;
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Direction enum
|
|
1018
|
+
* Indicates whether the App can send, receive, both, or neither.
|
|
1019
|
+
*/
|
|
1020
|
+
export type Direction = "send" | "recv" | "bidirectional" | "none";
|
|
1021
|
+
export declare const FfiConverterTypeDirection: {
|
|
1022
|
+
read(from: RustBuffer): Direction;
|
|
1023
|
+
write(value: Direction, into: RustBuffer): void;
|
|
1024
|
+
allocationSize(value: Direction): number;
|
|
1025
|
+
};
|
|
1026
|
+
/**
|
|
1027
|
+
* Identity provider configuration - used to prove identity to others
|
|
1028
|
+
*/
|
|
1029
|
+
export type IdentityProviderConfig =
|
|
1030
|
+
/**
|
|
1031
|
+
* Shared secret authentication (symmetric key)
|
|
1032
|
+
*/
|
|
1033
|
+
{
|
|
1034
|
+
tag: "sharedSecret";
|
|
1035
|
+
inner: Readonly<{
|
|
1036
|
+
id: string;
|
|
1037
|
+
data: string;
|
|
1038
|
+
}>;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Static JWT loaded from file with auto-reload
|
|
1042
|
+
*/
|
|
1043
|
+
| {
|
|
1044
|
+
tag: "staticJwt";
|
|
1045
|
+
inner: Readonly<{
|
|
1046
|
+
config: StaticJwtAuth;
|
|
1047
|
+
}>;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Dynamic JWT generation with signing key
|
|
1051
|
+
*/
|
|
1052
|
+
| {
|
|
1053
|
+
tag: "jwt";
|
|
1054
|
+
inner: Readonly<{
|
|
1055
|
+
config: ClientJwtAuth;
|
|
1056
|
+
}>;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* SPIRE-based identity provider (non-Windows only)
|
|
1060
|
+
*/
|
|
1061
|
+
| {
|
|
1062
|
+
tag: "spire";
|
|
1063
|
+
inner: Readonly<{
|
|
1064
|
+
config: SpireConfig;
|
|
1065
|
+
}>;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* No identity provider configured
|
|
1069
|
+
*/
|
|
1070
|
+
| {
|
|
1071
|
+
tag: "none";
|
|
1072
|
+
};
|
|
1073
|
+
export declare const FfiConverterTypeIdentityProviderConfig: {
|
|
1074
|
+
read(from: RustBuffer): IdentityProviderConfig;
|
|
1075
|
+
write(value: IdentityProviderConfig, into: RustBuffer): void;
|
|
1076
|
+
allocationSize(value: IdentityProviderConfig): number;
|
|
1077
|
+
};
|
|
1078
|
+
/**
|
|
1079
|
+
* Identity verifier configuration - used to verify identity of others
|
|
1080
|
+
*/
|
|
1081
|
+
export type IdentityVerifierConfig =
|
|
1082
|
+
/**
|
|
1083
|
+
* Shared secret verification (symmetric key)
|
|
1084
|
+
*/
|
|
1085
|
+
{
|
|
1086
|
+
tag: "sharedSecret";
|
|
1087
|
+
inner: Readonly<{
|
|
1088
|
+
id: string;
|
|
1089
|
+
data: string;
|
|
1090
|
+
}>;
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* JWT verification with decoding key
|
|
1094
|
+
*/
|
|
1095
|
+
| {
|
|
1096
|
+
tag: "jwt";
|
|
1097
|
+
inner: Readonly<{
|
|
1098
|
+
config: JwtAuth;
|
|
1099
|
+
}>;
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* SPIRE-based identity verifier (non-Windows only)
|
|
1103
|
+
*/
|
|
1104
|
+
| {
|
|
1105
|
+
tag: "spire";
|
|
1106
|
+
inner: Readonly<{
|
|
1107
|
+
config: SpireConfig;
|
|
1108
|
+
}>;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* No identity verifier configured
|
|
1112
|
+
*/
|
|
1113
|
+
| {
|
|
1114
|
+
tag: "none";
|
|
1115
|
+
};
|
|
1116
|
+
export declare const FfiConverterTypeIdentityVerifierConfig: {
|
|
1117
|
+
read(from: RustBuffer): IdentityVerifierConfig;
|
|
1118
|
+
write(value: IdentityVerifierConfig, into: RustBuffer): void;
|
|
1119
|
+
allocationSize(value: IdentityVerifierConfig): number;
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* JWT signing/verification algorithm
|
|
1123
|
+
*/
|
|
1124
|
+
export type JwtAlgorithm = "hs256" | "hs384" | "hs512" | "es256" | "es384" | "rs256" | "rs384" | "rs512" | "ps256" | "ps384" | "ps512" | "edDsa";
|
|
1125
|
+
export declare const FfiConverterTypeJwtAlgorithm: {
|
|
1126
|
+
read(from: RustBuffer): JwtAlgorithm;
|
|
1127
|
+
write(value: JwtAlgorithm, into: RustBuffer): void;
|
|
1128
|
+
allocationSize(value: JwtAlgorithm): number;
|
|
1129
|
+
};
|
|
1130
|
+
/**
|
|
1131
|
+
* JWT key data source
|
|
1132
|
+
*/
|
|
1133
|
+
export type JwtKeyData =
|
|
1134
|
+
/**
|
|
1135
|
+
* String with encoded key(s)
|
|
1136
|
+
*/
|
|
1137
|
+
{
|
|
1138
|
+
tag: "data";
|
|
1139
|
+
inner: Readonly<{
|
|
1140
|
+
value: string;
|
|
1141
|
+
}>;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* File path to the key(s)
|
|
1145
|
+
*/
|
|
1146
|
+
| {
|
|
1147
|
+
tag: "file";
|
|
1148
|
+
inner: Readonly<{
|
|
1149
|
+
path: string;
|
|
1150
|
+
}>;
|
|
1151
|
+
};
|
|
1152
|
+
export declare const FfiConverterTypeJwtKeyData: {
|
|
1153
|
+
read(from: RustBuffer): JwtKeyData;
|
|
1154
|
+
write(value: JwtKeyData, into: RustBuffer): void;
|
|
1155
|
+
allocationSize(value: JwtKeyData): number;
|
|
1156
|
+
};
|
|
1157
|
+
/**
|
|
1158
|
+
* JWT key format
|
|
1159
|
+
*/
|
|
1160
|
+
export type JwtKeyFormat = "pem" | "jwk" | "jwks";
|
|
1161
|
+
export declare const FfiConverterTypeJwtKeyFormat: {
|
|
1162
|
+
read(from: RustBuffer): JwtKeyFormat;
|
|
1163
|
+
write(value: JwtKeyFormat, into: RustBuffer): void;
|
|
1164
|
+
allocationSize(value: JwtKeyFormat): number;
|
|
1165
|
+
};
|
|
1166
|
+
/**
|
|
1167
|
+
* JWT key type (encoding, decoding, or autoresolve)
|
|
1168
|
+
*/
|
|
1169
|
+
export type JwtKeyType =
|
|
1170
|
+
/**
|
|
1171
|
+
* Encoding key for signing JWTs (client-side)
|
|
1172
|
+
*/
|
|
1173
|
+
{
|
|
1174
|
+
tag: "encoding";
|
|
1175
|
+
inner: Readonly<{
|
|
1176
|
+
key: JwtKeyConfig;
|
|
1177
|
+
}>;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Decoding key for verifying JWTs (server-side)
|
|
1181
|
+
*/
|
|
1182
|
+
| {
|
|
1183
|
+
tag: "decoding";
|
|
1184
|
+
inner: Readonly<{
|
|
1185
|
+
key: JwtKeyConfig;
|
|
1186
|
+
}>;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Automatically resolve keys based on claims
|
|
1190
|
+
*/
|
|
1191
|
+
| {
|
|
1192
|
+
tag: "autoresolve";
|
|
1193
|
+
};
|
|
1194
|
+
export declare const FfiConverterTypeJwtKeyType: {
|
|
1195
|
+
read(from: RustBuffer): JwtKeyType;
|
|
1196
|
+
write(value: JwtKeyType, into: RustBuffer): void;
|
|
1197
|
+
allocationSize(value: JwtKeyType): number;
|
|
1198
|
+
};
|
|
1199
|
+
/**
|
|
1200
|
+
* UniFFI-compatible RPC error
|
|
1201
|
+
*
|
|
1202
|
+
* This wraps Status to make it compatible with UniFFI foreign language bindings.
|
|
1203
|
+
* UniFFI requires errors to be represented as enums with associated data.
|
|
1204
|
+
*/
|
|
1205
|
+
export type RpcError = "rpc";
|
|
1206
|
+
export declare const FfiConverterTypeRpcError: {
|
|
1207
|
+
read(from: RustBuffer): RpcError;
|
|
1208
|
+
write(value: RpcError, into: RustBuffer): void;
|
|
1209
|
+
allocationSize(value: RpcError): number;
|
|
1210
|
+
};
|
|
1211
|
+
/**
|
|
1212
|
+
* Authentication configuration enum for server
|
|
1213
|
+
*/
|
|
1214
|
+
export type ServerAuthenticationConfig = {
|
|
1215
|
+
tag: "basic";
|
|
1216
|
+
inner: Readonly<{
|
|
1217
|
+
config: BasicAuth;
|
|
1218
|
+
}>;
|
|
1219
|
+
} | {
|
|
1220
|
+
tag: "jwt";
|
|
1221
|
+
inner: Readonly<{
|
|
1222
|
+
config: JwtAuth;
|
|
1223
|
+
}>;
|
|
1224
|
+
} | {
|
|
1225
|
+
tag: "none";
|
|
1226
|
+
};
|
|
1227
|
+
export declare const FfiConverterTypeServerAuthenticationConfig: {
|
|
1228
|
+
read(from: RustBuffer): ServerAuthenticationConfig;
|
|
1229
|
+
write(value: ServerAuthenticationConfig, into: RustBuffer): void;
|
|
1230
|
+
allocationSize(value: ServerAuthenticationConfig): number;
|
|
1231
|
+
};
|
|
1232
|
+
/**
|
|
1233
|
+
* Session type enum
|
|
1234
|
+
*/
|
|
1235
|
+
export type SessionType = "pointToPoint" | "group";
|
|
1236
|
+
export declare const FfiConverterTypeSessionType: {
|
|
1237
|
+
read(from: RustBuffer): SessionType;
|
|
1238
|
+
write(value: SessionType, into: RustBuffer): void;
|
|
1239
|
+
allocationSize(value: SessionType): number;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* Error types for SLIM operations
|
|
1243
|
+
*/
|
|
1244
|
+
export type SlimError = {
|
|
1245
|
+
tag: "serviceError";
|
|
1246
|
+
inner: Readonly<{
|
|
1247
|
+
message: string;
|
|
1248
|
+
}>;
|
|
1249
|
+
} | {
|
|
1250
|
+
tag: "sessionError";
|
|
1251
|
+
inner: Readonly<{
|
|
1252
|
+
message: string;
|
|
1253
|
+
}>;
|
|
1254
|
+
} | {
|
|
1255
|
+
tag: "receiveError";
|
|
1256
|
+
inner: Readonly<{
|
|
1257
|
+
message: string;
|
|
1258
|
+
}>;
|
|
1259
|
+
} | {
|
|
1260
|
+
tag: "sendError";
|
|
1261
|
+
inner: Readonly<{
|
|
1262
|
+
message: string;
|
|
1263
|
+
}>;
|
|
1264
|
+
} | {
|
|
1265
|
+
tag: "authError";
|
|
1266
|
+
inner: Readonly<{
|
|
1267
|
+
message: string;
|
|
1268
|
+
}>;
|
|
1269
|
+
} | {
|
|
1270
|
+
tag: "configError";
|
|
1271
|
+
inner: Readonly<{
|
|
1272
|
+
message: string;
|
|
1273
|
+
}>;
|
|
1274
|
+
} | {
|
|
1275
|
+
tag: "rpcError";
|
|
1276
|
+
inner: Readonly<{
|
|
1277
|
+
message: string;
|
|
1278
|
+
}>;
|
|
1279
|
+
} | {
|
|
1280
|
+
tag: "timeout";
|
|
1281
|
+
} | {
|
|
1282
|
+
tag: "invalidArgument";
|
|
1283
|
+
inner: Readonly<{
|
|
1284
|
+
message: string;
|
|
1285
|
+
}>;
|
|
1286
|
+
} | {
|
|
1287
|
+
tag: "internalError";
|
|
1288
|
+
inner: Readonly<{
|
|
1289
|
+
message: string;
|
|
1290
|
+
}>;
|
|
1291
|
+
};
|
|
1292
|
+
export declare const FfiConverterTypeSlimError: {
|
|
1293
|
+
read(from: RustBuffer): SlimError;
|
|
1294
|
+
write(value: SlimError, into: RustBuffer): void;
|
|
1295
|
+
allocationSize(value: SlimError): number;
|
|
1296
|
+
};
|
|
1297
|
+
/**
|
|
1298
|
+
* Message from a stream
|
|
1299
|
+
*/
|
|
1300
|
+
export type StreamMessage =
|
|
1301
|
+
/**
|
|
1302
|
+
* Successfully received data
|
|
1303
|
+
*/
|
|
1304
|
+
{
|
|
1305
|
+
tag: "data";
|
|
1306
|
+
inner: Readonly<[ArrayBuffer]>;
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Stream error occurred
|
|
1310
|
+
*/
|
|
1311
|
+
| {
|
|
1312
|
+
tag: "error";
|
|
1313
|
+
inner: Readonly<[RpcError]>;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Stream has ended
|
|
1317
|
+
*/
|
|
1318
|
+
| {
|
|
1319
|
+
tag: "end";
|
|
1320
|
+
};
|
|
1321
|
+
export declare const FfiConverterTypeStreamMessage: {
|
|
1322
|
+
read(from: RustBuffer): StreamMessage;
|
|
1323
|
+
write(value: StreamMessage, into: RustBuffer): void;
|
|
1324
|
+
allocationSize(value: StreamMessage): number;
|
|
1325
|
+
};
|
|
1326
|
+
/**
|
|
1327
|
+
* TLS certificate and key source configuration
|
|
1328
|
+
*/
|
|
1329
|
+
export type TlsSource =
|
|
1330
|
+
/**
|
|
1331
|
+
* Load certificate and key from PEM strings
|
|
1332
|
+
*/
|
|
1333
|
+
{
|
|
1334
|
+
tag: "pem";
|
|
1335
|
+
inner: Readonly<{
|
|
1336
|
+
cert: string;
|
|
1337
|
+
key: string;
|
|
1338
|
+
}>;
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Load certificate and key from files (with auto-reload support)
|
|
1342
|
+
*/
|
|
1343
|
+
| {
|
|
1344
|
+
tag: "file";
|
|
1345
|
+
inner: Readonly<{
|
|
1346
|
+
cert: string;
|
|
1347
|
+
key: string;
|
|
1348
|
+
}>;
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Load certificate and key from SPIRE Workload API
|
|
1352
|
+
*/
|
|
1353
|
+
| {
|
|
1354
|
+
tag: "spire";
|
|
1355
|
+
inner: Readonly<{
|
|
1356
|
+
config: SpireConfig;
|
|
1357
|
+
}>;
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* No certificate/key configured
|
|
1361
|
+
*/
|
|
1362
|
+
| {
|
|
1363
|
+
tag: "none";
|
|
1364
|
+
};
|
|
1365
|
+
export declare const FfiConverterTypeTlsSource: {
|
|
1366
|
+
read(from: RustBuffer): TlsSource;
|
|
1367
|
+
write(value: TlsSource, into: RustBuffer): void;
|
|
1368
|
+
allocationSize(value: TlsSource): number;
|
|
1369
|
+
};
|
|
1370
|
+
export type AppInterface = {
|
|
1371
|
+
/**
|
|
1372
|
+
* Create a new session (blocking version for FFI)
|
|
1373
|
+
*
|
|
1374
|
+
* Returns a SessionWithCompletion containing the session context and a completion handle.
|
|
1375
|
+
* Call `.wait()` on the completion handle to wait for session establishment.
|
|
1376
|
+
*/ createSession(config: SessionConfig, destination: Name): SessionWithCompletion;
|
|
1377
|
+
/**
|
|
1378
|
+
* Create a new session and wait for completion (blocking version)
|
|
1379
|
+
*
|
|
1380
|
+
* This method creates a session and blocks until the session establishment completes.
|
|
1381
|
+
* Returns only the session context, as the completion has already been awaited.
|
|
1382
|
+
*/ createSessionAndWait(config: SessionConfig, destination: Name): Session;
|
|
1383
|
+
/**
|
|
1384
|
+
* Create a new session and wait for completion (async version)
|
|
1385
|
+
*
|
|
1386
|
+
* This method creates a session and waits until the session establishment completes.
|
|
1387
|
+
* Returns only the session context, as the completion has already been awaited.
|
|
1388
|
+
*/ createSessionAndWaitAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
|
|
1389
|
+
signal: AbortSignal;
|
|
1390
|
+
}): Promise<Session>;
|
|
1391
|
+
/**
|
|
1392
|
+
* Create a new session (async version)
|
|
1393
|
+
*
|
|
1394
|
+
* Returns a SessionWithCompletion containing the session context and a completion handle.
|
|
1395
|
+
* Await the completion handle to wait for session establishment.
|
|
1396
|
+
* For point-to-point sessions, this ensures the remote peer has acknowledged the session.
|
|
1397
|
+
* For multicast sessions, this ensures the initial setup is complete.
|
|
1398
|
+
*/ createSessionAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
|
|
1399
|
+
signal: AbortSignal;
|
|
1400
|
+
}): Promise<SessionWithCompletion>;
|
|
1401
|
+
/**
|
|
1402
|
+
* Delete a session (blocking version for FFI)
|
|
1403
|
+
*
|
|
1404
|
+
* Returns a completion handle that can be awaited to ensure the deletion completes.
|
|
1405
|
+
*/ deleteSession(session: Session): CompletionHandle;
|
|
1406
|
+
/**
|
|
1407
|
+
* Delete a session and wait for completion (blocking version)
|
|
1408
|
+
*
|
|
1409
|
+
* This method deletes a session and blocks until the deletion completes.
|
|
1410
|
+
*/ deleteSessionAndWait(session: Session): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* Delete a session and wait for completion (async version)
|
|
1413
|
+
*
|
|
1414
|
+
* This method deletes a session and waits until the deletion completes.
|
|
1415
|
+
*/ deleteSessionAndWaitAsync(session: Session, asyncOpts_?: {
|
|
1416
|
+
signal: AbortSignal;
|
|
1417
|
+
}): void;
|
|
1418
|
+
/**
|
|
1419
|
+
* Delete a session (async version)
|
|
1420
|
+
*
|
|
1421
|
+
* Returns a completion handle that can be awaited to ensure the deletion completes.
|
|
1422
|
+
*/ deleteSessionAsync(session: Session, asyncOpts_?: {
|
|
1423
|
+
signal: AbortSignal;
|
|
1424
|
+
}): Promise<CompletionHandle>;
|
|
1425
|
+
/**
|
|
1426
|
+
* Get the app ID (derived from name)
|
|
1427
|
+
*/ id(): bigint;
|
|
1428
|
+
/**
|
|
1429
|
+
* Listen for incoming sessions (blocking version for FFI)
|
|
1430
|
+
*/ listenForSession(timeout: number | undefined): Session;
|
|
1431
|
+
/**
|
|
1432
|
+
* Listen for incoming sessions (async version)
|
|
1433
|
+
*/ listenForSessionAsync(timeout: number | undefined, asyncOpts_?: {
|
|
1434
|
+
signal: AbortSignal;
|
|
1435
|
+
}): Promise<Session>;
|
|
1436
|
+
/**
|
|
1437
|
+
* Get the app name
|
|
1438
|
+
*/ name(): Name;
|
|
1439
|
+
/**
|
|
1440
|
+
* Remove a route (blocking version for FFI)
|
|
1441
|
+
*/ removeRoute(name: Name, connectionId: bigint): void;
|
|
1442
|
+
/**
|
|
1443
|
+
* Remove a route (async version)
|
|
1444
|
+
*/ removeRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
|
|
1445
|
+
signal: AbortSignal;
|
|
1446
|
+
}): void;
|
|
1447
|
+
/**
|
|
1448
|
+
* Set a route to a name for a specific connection (blocking version for FFI)
|
|
1449
|
+
*/ setRoute(name: Name, connectionId: bigint): void;
|
|
1450
|
+
/**
|
|
1451
|
+
* Set a route to a name for a specific connection (async version)
|
|
1452
|
+
*/ setRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
|
|
1453
|
+
signal: AbortSignal;
|
|
1454
|
+
}): void;
|
|
1455
|
+
/**
|
|
1456
|
+
* Subscribe to a session name (blocking version for FFI)
|
|
1457
|
+
*/ subscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
|
|
1458
|
+
/**
|
|
1459
|
+
* Subscribe to a name (async version)
|
|
1460
|
+
*/ subscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
|
|
1461
|
+
signal: AbortSignal;
|
|
1462
|
+
}): void;
|
|
1463
|
+
/**
|
|
1464
|
+
* Unsubscribe from a name (blocking version for FFI)
|
|
1465
|
+
*/ unsubscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
|
|
1466
|
+
/**
|
|
1467
|
+
* Unsubscribe from a name (async version)
|
|
1468
|
+
*/ unsubscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
|
|
1469
|
+
signal: AbortSignal;
|
|
1470
|
+
}): void;
|
|
1471
|
+
};
|
|
1472
|
+
/**
|
|
1473
|
+
* Adapter that bridges the App API with language-bindings interface
|
|
1474
|
+
*
|
|
1475
|
+
* This adapter uses enum-based auth types (`AuthProvider`/`AuthVerifier`) instead of generics
|
|
1476
|
+
* to be compatible with UniFFI, supporting multiple authentication mechanisms (SharedSecret,
|
|
1477
|
+
* JWT, SPIRE, StaticToken). It provides both synchronous (blocking) and asynchronous methods
|
|
1478
|
+
* for flexibility.
|
|
1479
|
+
*/
|
|
1480
|
+
export declare class App extends UniffiAbstractObject implements AppInterface {
|
|
1481
|
+
readonly [uniffiTypeNameSymbol]: "App";
|
|
1482
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
1483
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
1484
|
+
/**
|
|
1485
|
+
* Create a new App with identity provider and verifier configurations
|
|
1486
|
+
*
|
|
1487
|
+
* This is the main entry point for creating a SLIM application from language bindings.
|
|
1488
|
+
*
|
|
1489
|
+
* # Arguments
|
|
1490
|
+
* * `base_name` - The base name for the app (without ID)
|
|
1491
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
1492
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
1493
|
+
*
|
|
1494
|
+
* # Returns
|
|
1495
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
1496
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
1497
|
+
*
|
|
1498
|
+
* # Supported Identity Types
|
|
1499
|
+
* - SharedSecret: Symmetric key authentication
|
|
1500
|
+
* - JWT: Dynamic JWT generation/verification with signing/decoding keys
|
|
1501
|
+
* - StaticJWT: Static JWT loaded from file with auto-reload
|
|
1502
|
+
*/
|
|
1503
|
+
constructor(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig);
|
|
1504
|
+
/**
|
|
1505
|
+
* Create a new App with traffic direction (blocking version)
|
|
1506
|
+
*
|
|
1507
|
+
* This is a convenience function for creating a SLIM application with configurable
|
|
1508
|
+
* traffic direction (send-only, receive-only, bidirectional, or none).
|
|
1509
|
+
*
|
|
1510
|
+
* # Arguments
|
|
1511
|
+
* * `name` - The base name for the app (without ID)
|
|
1512
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
1513
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
1514
|
+
* * `direction` - Traffic direction for sessions (Send, Recv, Bidirectional, or None)
|
|
1515
|
+
*
|
|
1516
|
+
* # Returns
|
|
1517
|
+
* * `Ok(Arc<App>)` - Successfully created app
|
|
1518
|
+
* * `Err(SlimError)` - If app creation fails
|
|
1519
|
+
*/
|
|
1520
|
+
static newWithDirection(name: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): App;
|
|
1521
|
+
/**
|
|
1522
|
+
* Create a new App with SharedSecret authentication (blocking version)
|
|
1523
|
+
*
|
|
1524
|
+
* This is a convenience function for creating a SLIM application using SharedSecret authentication.
|
|
1525
|
+
*
|
|
1526
|
+
* # Arguments
|
|
1527
|
+
* * `name` - The base name for the app (without ID)
|
|
1528
|
+
* * `secret` - The shared secret string for authentication
|
|
1529
|
+
*
|
|
1530
|
+
* # Returns
|
|
1531
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
1532
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
1533
|
+
*/
|
|
1534
|
+
static newWithSecret(name: Name, secret: string): App;
|
|
1535
|
+
/**
|
|
1536
|
+
* Create a new session (blocking version for FFI)
|
|
1537
|
+
*
|
|
1538
|
+
* Returns a SessionWithCompletion containing the session context and a completion handle.
|
|
1539
|
+
* Call `.wait()` on the completion handle to wait for session establishment.
|
|
1540
|
+
*/ createSession(config: SessionConfig, destination: Name): SessionWithCompletion;
|
|
1541
|
+
/**
|
|
1542
|
+
* Create a new session and wait for completion (blocking version)
|
|
1543
|
+
*
|
|
1544
|
+
* This method creates a session and blocks until the session establishment completes.
|
|
1545
|
+
* Returns only the session context, as the completion has already been awaited.
|
|
1546
|
+
*/ createSessionAndWait(config: SessionConfig, destination: Name): Session;
|
|
1547
|
+
/**
|
|
1548
|
+
* Create a new session and wait for completion (async version)
|
|
1549
|
+
*
|
|
1550
|
+
* This method creates a session and waits until the session establishment completes.
|
|
1551
|
+
* Returns only the session context, as the completion has already been awaited.
|
|
1552
|
+
*/ createSessionAndWaitAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
|
|
1553
|
+
signal: AbortSignal;
|
|
1554
|
+
}): Promise<Session>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Create a new session (async version)
|
|
1557
|
+
*
|
|
1558
|
+
* Returns a SessionWithCompletion containing the session context and a completion handle.
|
|
1559
|
+
* Await the completion handle to wait for session establishment.
|
|
1560
|
+
* For point-to-point sessions, this ensures the remote peer has acknowledged the session.
|
|
1561
|
+
* For multicast sessions, this ensures the initial setup is complete.
|
|
1562
|
+
*/ createSessionAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
|
|
1563
|
+
signal: AbortSignal;
|
|
1564
|
+
}): Promise<SessionWithCompletion>;
|
|
1565
|
+
/**
|
|
1566
|
+
* Delete a session (blocking version for FFI)
|
|
1567
|
+
*
|
|
1568
|
+
* Returns a completion handle that can be awaited to ensure the deletion completes.
|
|
1569
|
+
*/ deleteSession(session: Session): CompletionHandle;
|
|
1570
|
+
/**
|
|
1571
|
+
* Delete a session and wait for completion (blocking version)
|
|
1572
|
+
*
|
|
1573
|
+
* This method deletes a session and blocks until the deletion completes.
|
|
1574
|
+
*/ deleteSessionAndWait(session: Session): void;
|
|
1575
|
+
/**
|
|
1576
|
+
* Delete a session and wait for completion (async version)
|
|
1577
|
+
*
|
|
1578
|
+
* This method deletes a session and waits until the deletion completes.
|
|
1579
|
+
*/ deleteSessionAndWaitAsync(session: Session, asyncOpts_?: {
|
|
1580
|
+
signal: AbortSignal;
|
|
1581
|
+
}): void;
|
|
1582
|
+
/**
|
|
1583
|
+
* Delete a session (async version)
|
|
1584
|
+
*
|
|
1585
|
+
* Returns a completion handle that can be awaited to ensure the deletion completes.
|
|
1586
|
+
*/ deleteSessionAsync(session: Session, asyncOpts_?: {
|
|
1587
|
+
signal: AbortSignal;
|
|
1588
|
+
}): Promise<CompletionHandle>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Get the app ID (derived from name)
|
|
1591
|
+
*/ id(): bigint;
|
|
1592
|
+
/**
|
|
1593
|
+
* Listen for incoming sessions (blocking version for FFI)
|
|
1594
|
+
*/ listenForSession(timeout: number | undefined): Session;
|
|
1595
|
+
/**
|
|
1596
|
+
* Listen for incoming sessions (async version)
|
|
1597
|
+
*/ listenForSessionAsync(timeout: number | undefined, asyncOpts_?: {
|
|
1598
|
+
signal: AbortSignal;
|
|
1599
|
+
}): Promise<Session>;
|
|
1600
|
+
/**
|
|
1601
|
+
* Get the app name
|
|
1602
|
+
*/ name(): Name;
|
|
1603
|
+
/**
|
|
1604
|
+
* Remove a route (blocking version for FFI)
|
|
1605
|
+
*/ removeRoute(name: Name, connectionId: bigint): void;
|
|
1606
|
+
/**
|
|
1607
|
+
* Remove a route (async version)
|
|
1608
|
+
*/ removeRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
|
|
1609
|
+
signal: AbortSignal;
|
|
1610
|
+
}): void;
|
|
1611
|
+
/**
|
|
1612
|
+
* Set a route to a name for a specific connection (blocking version for FFI)
|
|
1613
|
+
*/ setRoute(name: Name, connectionId: bigint): void;
|
|
1614
|
+
/**
|
|
1615
|
+
* Set a route to a name for a specific connection (async version)
|
|
1616
|
+
*/ setRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
|
|
1617
|
+
signal: AbortSignal;
|
|
1618
|
+
}): void;
|
|
1619
|
+
/**
|
|
1620
|
+
* Subscribe to a session name (blocking version for FFI)
|
|
1621
|
+
*/ subscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
|
|
1622
|
+
/**
|
|
1623
|
+
* Subscribe to a name (async version)
|
|
1624
|
+
*/ subscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
|
|
1625
|
+
signal: AbortSignal;
|
|
1626
|
+
}): void;
|
|
1627
|
+
/**
|
|
1628
|
+
* Unsubscribe from a name (blocking version for FFI)
|
|
1629
|
+
*/ unsubscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
|
|
1630
|
+
/**
|
|
1631
|
+
* Unsubscribe from a name (async version)
|
|
1632
|
+
*/ unsubscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
|
|
1633
|
+
signal: AbortSignal;
|
|
1634
|
+
}): void;
|
|
1635
|
+
/**
|
|
1636
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
1637
|
+
*/
|
|
1638
|
+
uniffiDestroy(): void;
|
|
1639
|
+
[Symbol.dispose]: () => void;
|
|
1640
|
+
static instanceOf(obj: any): obj is App;
|
|
1641
|
+
}
|
|
1642
|
+
export type BidiStreamHandlerInterface = {
|
|
1643
|
+
/**
|
|
1644
|
+
* Close the request stream (no more messages will be sent)
|
|
1645
|
+
*/ closeSend(): void;
|
|
1646
|
+
/**
|
|
1647
|
+
* Close the request stream (async version)
|
|
1648
|
+
*/ closeSendAsync(asyncOpts_?: {
|
|
1649
|
+
signal: AbortSignal;
|
|
1650
|
+
}): void;
|
|
1651
|
+
/**
|
|
1652
|
+
* Receive the next response message (blocking version)
|
|
1653
|
+
*/ recv(): StreamMessage;
|
|
1654
|
+
/**
|
|
1655
|
+
* Receive the next response message (async version)
|
|
1656
|
+
*/ recvAsync(asyncOpts_?: {
|
|
1657
|
+
signal: AbortSignal;
|
|
1658
|
+
}): Promise<StreamMessage>;
|
|
1659
|
+
/**
|
|
1660
|
+
* Send a request message to the stream (blocking version)
|
|
1661
|
+
*/ send(data: ArrayBuffer): void;
|
|
1662
|
+
/**
|
|
1663
|
+
* Send a request message to the stream (async version)
|
|
1664
|
+
*/ sendAsync(data: ArrayBuffer, asyncOpts_?: {
|
|
1665
|
+
signal: AbortSignal;
|
|
1666
|
+
}): void;
|
|
1667
|
+
};
|
|
1668
|
+
/**
|
|
1669
|
+
* Bidirectional stream handler for stream-to-stream RPC calls
|
|
1670
|
+
*
|
|
1671
|
+
* Allows sending and receiving messages concurrently.
|
|
1672
|
+
*/
|
|
1673
|
+
export declare class BidiStreamHandler extends UniffiAbstractObject implements BidiStreamHandlerInterface {
|
|
1674
|
+
readonly [uniffiTypeNameSymbol]: "BidiStreamHandler";
|
|
1675
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
1676
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
1677
|
+
/**
|
|
1678
|
+
* Close the request stream (no more messages will be sent)
|
|
1679
|
+
*/ closeSend(): void;
|
|
1680
|
+
/**
|
|
1681
|
+
* Close the request stream (async version)
|
|
1682
|
+
*/ closeSendAsync(asyncOpts_?: {
|
|
1683
|
+
signal: AbortSignal;
|
|
1684
|
+
}): void;
|
|
1685
|
+
/**
|
|
1686
|
+
* Receive the next response message (blocking version)
|
|
1687
|
+
*/ recv(): StreamMessage;
|
|
1688
|
+
/**
|
|
1689
|
+
* Receive the next response message (async version)
|
|
1690
|
+
*/ recvAsync(asyncOpts_?: {
|
|
1691
|
+
signal: AbortSignal;
|
|
1692
|
+
}): Promise<StreamMessage>;
|
|
1693
|
+
/**
|
|
1694
|
+
* Send a request message to the stream (blocking version)
|
|
1695
|
+
*/ send(data: ArrayBuffer): void;
|
|
1696
|
+
/**
|
|
1697
|
+
* Send a request message to the stream (async version)
|
|
1698
|
+
*/ sendAsync(data: ArrayBuffer, asyncOpts_?: {
|
|
1699
|
+
signal: AbortSignal;
|
|
1700
|
+
}): void;
|
|
1701
|
+
/**
|
|
1702
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
1703
|
+
*/
|
|
1704
|
+
uniffiDestroy(): void;
|
|
1705
|
+
[Symbol.dispose]: () => void;
|
|
1706
|
+
static instanceOf(obj: any): obj is BidiStreamHandler;
|
|
1707
|
+
}
|
|
1708
|
+
export type ChannelInterface = {
|
|
1709
|
+
/**
|
|
1710
|
+
* Make a stream-to-stream RPC call (blocking version)
|
|
1711
|
+
*
|
|
1712
|
+
* # Arguments
|
|
1713
|
+
* * `service_name` - The service name
|
|
1714
|
+
* * `method_name` - The method name
|
|
1715
|
+
* * `timeout` - Optional timeout duration
|
|
1716
|
+
*
|
|
1717
|
+
* # Returns
|
|
1718
|
+
* A BidiStreamHandler for sending and receiving messages
|
|
1719
|
+
*
|
|
1720
|
+
* # Note
|
|
1721
|
+
* This returns a BidiStreamHandler that can be used to send request messages
|
|
1722
|
+
* and read response messages concurrently.
|
|
1723
|
+
*/ callStreamStream(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): BidiStreamHandler;
|
|
1724
|
+
/**
|
|
1725
|
+
* Make a stream-to-unary RPC call (blocking version)
|
|
1726
|
+
*
|
|
1727
|
+
* # Arguments
|
|
1728
|
+
* * `service_name` - The service name
|
|
1729
|
+
* * `method_name` - The method name
|
|
1730
|
+
* * `timeout` - Optional timeout duration
|
|
1731
|
+
*
|
|
1732
|
+
* # Returns
|
|
1733
|
+
* A RequestStreamWriter for sending request messages and getting the final response
|
|
1734
|
+
*
|
|
1735
|
+
* # Note
|
|
1736
|
+
* This returns a RequestStreamWriter that can be used to send multiple request
|
|
1737
|
+
* messages and then finalize to get the single response.
|
|
1738
|
+
*/ callStreamUnary(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): RequestStreamWriter;
|
|
1739
|
+
/**
|
|
1740
|
+
* Make a unary-to-unary RPC call (blocking version)
|
|
1741
|
+
*
|
|
1742
|
+
* # Arguments
|
|
1743
|
+
* * `service_name` - The service name (e.g., "MyService")
|
|
1744
|
+
* * `method_name` - The method name (e.g., "GetUser")
|
|
1745
|
+
* * `request` - The request message bytes
|
|
1746
|
+
* * `timeout` - Optional timeout duration
|
|
1747
|
+
*
|
|
1748
|
+
* # Returns
|
|
1749
|
+
* The response message bytes or an error
|
|
1750
|
+
*/ callUnary(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ArrayBuffer;
|
|
1751
|
+
/**
|
|
1752
|
+
* Make a unary-to-unary RPC call (async version)
|
|
1753
|
+
*
|
|
1754
|
+
* # Arguments
|
|
1755
|
+
* * `service_name` - The service name (e.g., "MyService")
|
|
1756
|
+
* * `method_name` - The method name (e.g., "GetUser")
|
|
1757
|
+
* * `request` - The request message bytes
|
|
1758
|
+
* * `timeout` - Optional timeout duration
|
|
1759
|
+
*
|
|
1760
|
+
* # Returns
|
|
1761
|
+
* The response message bytes or an error
|
|
1762
|
+
*/ callUnaryAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
1763
|
+
signal: AbortSignal;
|
|
1764
|
+
}): Promise<ArrayBuffer>;
|
|
1765
|
+
/**
|
|
1766
|
+
* Make a unary-to-stream RPC call (blocking version)
|
|
1767
|
+
*
|
|
1768
|
+
* # Arguments
|
|
1769
|
+
* * `service_name` - The service name
|
|
1770
|
+
* * `method_name` - The method name
|
|
1771
|
+
* * `request` - The request message bytes
|
|
1772
|
+
* * `timeout` - Optional timeout duration
|
|
1773
|
+
*
|
|
1774
|
+
* # Returns
|
|
1775
|
+
* A stream reader for pulling response messages
|
|
1776
|
+
*
|
|
1777
|
+
* # Note
|
|
1778
|
+
* This returns a ResponseStreamReader that can be used to pull messages
|
|
1779
|
+
* one at a time from the response stream.
|
|
1780
|
+
*/ callUnaryStream(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ResponseStreamReader;
|
|
1781
|
+
/**
|
|
1782
|
+
* Make a unary-to-stream RPC call (async version)
|
|
1783
|
+
*
|
|
1784
|
+
* # Arguments
|
|
1785
|
+
* * `service_name` - The service name
|
|
1786
|
+
* * `method_name` - The method name
|
|
1787
|
+
* * `request` - The request message bytes
|
|
1788
|
+
* * `timeout` - Optional timeout duration
|
|
1789
|
+
*
|
|
1790
|
+
* # Returns
|
|
1791
|
+
* A stream reader for pulling response messages
|
|
1792
|
+
*
|
|
1793
|
+
* # Note
|
|
1794
|
+
* This returns a ResponseStreamReader that can be used to pull messages
|
|
1795
|
+
* one at a time from the response stream.
|
|
1796
|
+
*/ callUnaryStreamAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
1797
|
+
signal: AbortSignal;
|
|
1798
|
+
}): Promise<ResponseStreamReader>;
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* Client-side channel for making RPC calls
|
|
1802
|
+
*
|
|
1803
|
+
* A Channel manages the connection to a remote service and provides methods
|
|
1804
|
+
* for making RPC calls with different streaming patterns.
|
|
1805
|
+
*
|
|
1806
|
+
* Each RPC call creates a new session which is closed after the RPC completes.
|
|
1807
|
+
*/
|
|
1808
|
+
export declare class Channel extends UniffiAbstractObject implements ChannelInterface {
|
|
1809
|
+
readonly [uniffiTypeNameSymbol]: "Channel";
|
|
1810
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
1811
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
1812
|
+
/**
|
|
1813
|
+
* Create a new RPC channel
|
|
1814
|
+
*
|
|
1815
|
+
* # Arguments
|
|
1816
|
+
* * `app` - The SLIM application instance
|
|
1817
|
+
* * `remote` - The remote service name to connect to
|
|
1818
|
+
*
|
|
1819
|
+
* # Returns
|
|
1820
|
+
* A new channel instance
|
|
1821
|
+
*/
|
|
1822
|
+
constructor(app: App, remote: Name);
|
|
1823
|
+
/**
|
|
1824
|
+
* Create a new RPC channel with optional connection ID
|
|
1825
|
+
*
|
|
1826
|
+
* The connection ID is used to set up routing before making RPC calls,
|
|
1827
|
+
* enabling multi-hop RPC calls through specific connections.
|
|
1828
|
+
*
|
|
1829
|
+
* # Arguments
|
|
1830
|
+
* * `app` - The SLIM application instance
|
|
1831
|
+
* * `remote` - The remote service name to connect to
|
|
1832
|
+
* * `connection_id` - Optional connection ID for routing setup
|
|
1833
|
+
*
|
|
1834
|
+
* # Returns
|
|
1835
|
+
* A new channel instance
|
|
1836
|
+
*/
|
|
1837
|
+
static newWithConnection(app: App, remote: Name, connectionId: /*u64*/ bigint | undefined): Channel;
|
|
1838
|
+
/**
|
|
1839
|
+
* Make a stream-to-stream RPC call (blocking version)
|
|
1840
|
+
*
|
|
1841
|
+
* # Arguments
|
|
1842
|
+
* * `service_name` - The service name
|
|
1843
|
+
* * `method_name` - The method name
|
|
1844
|
+
* * `timeout` - Optional timeout duration
|
|
1845
|
+
*
|
|
1846
|
+
* # Returns
|
|
1847
|
+
* A BidiStreamHandler for sending and receiving messages
|
|
1848
|
+
*
|
|
1849
|
+
* # Note
|
|
1850
|
+
* This returns a BidiStreamHandler that can be used to send request messages
|
|
1851
|
+
* and read response messages concurrently.
|
|
1852
|
+
*/ callStreamStream(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): BidiStreamHandler;
|
|
1853
|
+
/**
|
|
1854
|
+
* Make a stream-to-unary RPC call (blocking version)
|
|
1855
|
+
*
|
|
1856
|
+
* # Arguments
|
|
1857
|
+
* * `service_name` - The service name
|
|
1858
|
+
* * `method_name` - The method name
|
|
1859
|
+
* * `timeout` - Optional timeout duration
|
|
1860
|
+
*
|
|
1861
|
+
* # Returns
|
|
1862
|
+
* A RequestStreamWriter for sending request messages and getting the final response
|
|
1863
|
+
*
|
|
1864
|
+
* # Note
|
|
1865
|
+
* This returns a RequestStreamWriter that can be used to send multiple request
|
|
1866
|
+
* messages and then finalize to get the single response.
|
|
1867
|
+
*/ callStreamUnary(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): RequestStreamWriter;
|
|
1868
|
+
/**
|
|
1869
|
+
* Make a unary-to-unary RPC call (blocking version)
|
|
1870
|
+
*
|
|
1871
|
+
* # Arguments
|
|
1872
|
+
* * `service_name` - The service name (e.g., "MyService")
|
|
1873
|
+
* * `method_name` - The method name (e.g., "GetUser")
|
|
1874
|
+
* * `request` - The request message bytes
|
|
1875
|
+
* * `timeout` - Optional timeout duration
|
|
1876
|
+
*
|
|
1877
|
+
* # Returns
|
|
1878
|
+
* The response message bytes or an error
|
|
1879
|
+
*/ callUnary(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ArrayBuffer;
|
|
1880
|
+
/**
|
|
1881
|
+
* Make a unary-to-unary RPC call (async version)
|
|
1882
|
+
*
|
|
1883
|
+
* # Arguments
|
|
1884
|
+
* * `service_name` - The service name (e.g., "MyService")
|
|
1885
|
+
* * `method_name` - The method name (e.g., "GetUser")
|
|
1886
|
+
* * `request` - The request message bytes
|
|
1887
|
+
* * `timeout` - Optional timeout duration
|
|
1888
|
+
*
|
|
1889
|
+
* # Returns
|
|
1890
|
+
* The response message bytes or an error
|
|
1891
|
+
*/ callUnaryAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
1892
|
+
signal: AbortSignal;
|
|
1893
|
+
}): Promise<ArrayBuffer>;
|
|
1894
|
+
/**
|
|
1895
|
+
* Make a unary-to-stream RPC call (blocking version)
|
|
1896
|
+
*
|
|
1897
|
+
* # Arguments
|
|
1898
|
+
* * `service_name` - The service name
|
|
1899
|
+
* * `method_name` - The method name
|
|
1900
|
+
* * `request` - The request message bytes
|
|
1901
|
+
* * `timeout` - Optional timeout duration
|
|
1902
|
+
*
|
|
1903
|
+
* # Returns
|
|
1904
|
+
* A stream reader for pulling response messages
|
|
1905
|
+
*
|
|
1906
|
+
* # Note
|
|
1907
|
+
* This returns a ResponseStreamReader that can be used to pull messages
|
|
1908
|
+
* one at a time from the response stream.
|
|
1909
|
+
*/ callUnaryStream(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ResponseStreamReader;
|
|
1910
|
+
/**
|
|
1911
|
+
* Make a unary-to-stream RPC call (async version)
|
|
1912
|
+
*
|
|
1913
|
+
* # Arguments
|
|
1914
|
+
* * `service_name` - The service name
|
|
1915
|
+
* * `method_name` - The method name
|
|
1916
|
+
* * `request` - The request message bytes
|
|
1917
|
+
* * `timeout` - Optional timeout duration
|
|
1918
|
+
*
|
|
1919
|
+
* # Returns
|
|
1920
|
+
* A stream reader for pulling response messages
|
|
1921
|
+
*
|
|
1922
|
+
* # Note
|
|
1923
|
+
* This returns a ResponseStreamReader that can be used to pull messages
|
|
1924
|
+
* one at a time from the response stream.
|
|
1925
|
+
*/ callUnaryStreamAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
1926
|
+
signal: AbortSignal;
|
|
1927
|
+
}): Promise<ResponseStreamReader>;
|
|
1928
|
+
/**
|
|
1929
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
1930
|
+
*/
|
|
1931
|
+
uniffiDestroy(): void;
|
|
1932
|
+
[Symbol.dispose]: () => void;
|
|
1933
|
+
static instanceOf(obj: any): obj is Channel;
|
|
1934
|
+
}
|
|
1935
|
+
export type CompletionHandleInterface = {
|
|
1936
|
+
/**
|
|
1937
|
+
* Wait for the operation to complete indefinitely (blocking version)
|
|
1938
|
+
*
|
|
1939
|
+
* This blocks the calling thread until the operation completes.
|
|
1940
|
+
* Use this from Go or other languages when you need to ensure
|
|
1941
|
+
* an operation has finished before proceeding.
|
|
1942
|
+
*
|
|
1943
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
1944
|
+
* will return an error.
|
|
1945
|
+
*
|
|
1946
|
+
* # Returns
|
|
1947
|
+
* * `Ok(())` - Operation completed successfully
|
|
1948
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
1949
|
+
*/ wait(): void;
|
|
1950
|
+
/**
|
|
1951
|
+
* Wait for the operation to complete indefinitely (async version)
|
|
1952
|
+
*
|
|
1953
|
+
* This is the async version that integrates with UniFFI's polling mechanism.
|
|
1954
|
+
* The operation will yield control while waiting.
|
|
1955
|
+
*
|
|
1956
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
1957
|
+
* will return an error.
|
|
1958
|
+
*
|
|
1959
|
+
* # Returns
|
|
1960
|
+
* * `Ok(())` - Operation completed successfully
|
|
1961
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
1962
|
+
*/ waitAsync(asyncOpts_?: {
|
|
1963
|
+
signal: AbortSignal;
|
|
1964
|
+
}): void;
|
|
1965
|
+
/**
|
|
1966
|
+
* Wait for the operation to complete with a timeout (blocking version)
|
|
1967
|
+
*
|
|
1968
|
+
* This blocks the calling thread until the operation completes or the timeout expires.
|
|
1969
|
+
* Use this from Go or other languages when you need to ensure
|
|
1970
|
+
* an operation has finished before proceeding with a time limit.
|
|
1971
|
+
*
|
|
1972
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
1973
|
+
* will return an error.
|
|
1974
|
+
*
|
|
1975
|
+
* # Arguments
|
|
1976
|
+
* * `timeout` - Maximum time to wait for completion
|
|
1977
|
+
*
|
|
1978
|
+
* # Returns
|
|
1979
|
+
* * `Ok(())` - Operation completed successfully
|
|
1980
|
+
* * `Err(SlimError::Timeout)` - If the operation timed out
|
|
1981
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
1982
|
+
*/ waitFor(timeout: number): void;
|
|
1983
|
+
/**
|
|
1984
|
+
* Wait for the operation to complete with a timeout (async version)
|
|
1985
|
+
*
|
|
1986
|
+
* This is the async version that integrates with UniFFI's polling mechanism.
|
|
1987
|
+
* The operation will yield control while waiting until completion or timeout.
|
|
1988
|
+
*
|
|
1989
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
1990
|
+
* will return an error.
|
|
1991
|
+
*
|
|
1992
|
+
* # Arguments
|
|
1993
|
+
* * `timeout` - Maximum time to wait for completion
|
|
1994
|
+
*
|
|
1995
|
+
* # Returns
|
|
1996
|
+
* * `Ok(())` - Operation completed successfully
|
|
1997
|
+
* * `Err(SlimError::Timeout)` - If the operation timed out
|
|
1998
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
1999
|
+
*/ waitForAsync(timeout: number, asyncOpts_?: {
|
|
2000
|
+
signal: AbortSignal;
|
|
2001
|
+
}): void;
|
|
2002
|
+
};
|
|
2003
|
+
/**
|
|
2004
|
+
* FFI-compatible completion handle for async operations
|
|
2005
|
+
*
|
|
2006
|
+
* Represents a pending operation that can be awaited to ensure completion.
|
|
2007
|
+
* Used for operations that need delivery confirmation or handshake acknowledgment.
|
|
2008
|
+
*
|
|
2009
|
+
* # Examples
|
|
2010
|
+
*
|
|
2011
|
+
* Basic usage:
|
|
2012
|
+
* ```ignore
|
|
2013
|
+
* let completion = session.publish(data, None, None)?;
|
|
2014
|
+
* completion.wait()?; // Wait for delivery confirmation
|
|
2015
|
+
* ```
|
|
2016
|
+
*/
|
|
2017
|
+
export declare class CompletionHandle extends UniffiAbstractObject implements CompletionHandleInterface {
|
|
2018
|
+
readonly [uniffiTypeNameSymbol]: "CompletionHandle";
|
|
2019
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2020
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2021
|
+
/**
|
|
2022
|
+
* Wait for the operation to complete indefinitely (blocking version)
|
|
2023
|
+
*
|
|
2024
|
+
* This blocks the calling thread until the operation completes.
|
|
2025
|
+
* Use this from Go or other languages when you need to ensure
|
|
2026
|
+
* an operation has finished before proceeding.
|
|
2027
|
+
*
|
|
2028
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
2029
|
+
* will return an error.
|
|
2030
|
+
*
|
|
2031
|
+
* # Returns
|
|
2032
|
+
* * `Ok(())` - Operation completed successfully
|
|
2033
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
2034
|
+
*/ wait(): void;
|
|
2035
|
+
/**
|
|
2036
|
+
* Wait for the operation to complete indefinitely (async version)
|
|
2037
|
+
*
|
|
2038
|
+
* This is the async version that integrates with UniFFI's polling mechanism.
|
|
2039
|
+
* The operation will yield control while waiting.
|
|
2040
|
+
*
|
|
2041
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
2042
|
+
* will return an error.
|
|
2043
|
+
*
|
|
2044
|
+
* # Returns
|
|
2045
|
+
* * `Ok(())` - Operation completed successfully
|
|
2046
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
2047
|
+
*/ waitAsync(asyncOpts_?: {
|
|
2048
|
+
signal: AbortSignal;
|
|
2049
|
+
}): void;
|
|
2050
|
+
/**
|
|
2051
|
+
* Wait for the operation to complete with a timeout (blocking version)
|
|
2052
|
+
*
|
|
2053
|
+
* This blocks the calling thread until the operation completes or the timeout expires.
|
|
2054
|
+
* Use this from Go or other languages when you need to ensure
|
|
2055
|
+
* an operation has finished before proceeding with a time limit.
|
|
2056
|
+
*
|
|
2057
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
2058
|
+
* will return an error.
|
|
2059
|
+
*
|
|
2060
|
+
* # Arguments
|
|
2061
|
+
* * `timeout` - Maximum time to wait for completion
|
|
2062
|
+
*
|
|
2063
|
+
* # Returns
|
|
2064
|
+
* * `Ok(())` - Operation completed successfully
|
|
2065
|
+
* * `Err(SlimError::Timeout)` - If the operation timed out
|
|
2066
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
2067
|
+
*/ waitFor(timeout: number): void;
|
|
2068
|
+
/**
|
|
2069
|
+
* Wait for the operation to complete with a timeout (async version)
|
|
2070
|
+
*
|
|
2071
|
+
* This is the async version that integrates with UniFFI's polling mechanism.
|
|
2072
|
+
* The operation will yield control while waiting until completion or timeout.
|
|
2073
|
+
*
|
|
2074
|
+
* **Note:** This can only be called once per handle. Subsequent calls
|
|
2075
|
+
* will return an error.
|
|
2076
|
+
*
|
|
2077
|
+
* # Arguments
|
|
2078
|
+
* * `timeout` - Maximum time to wait for completion
|
|
2079
|
+
*
|
|
2080
|
+
* # Returns
|
|
2081
|
+
* * `Ok(())` - Operation completed successfully
|
|
2082
|
+
* * `Err(SlimError::Timeout)` - If the operation timed out
|
|
2083
|
+
* * `Err(SlimError)` - Operation failed or handle already consumed
|
|
2084
|
+
*/ waitForAsync(timeout: number, asyncOpts_?: {
|
|
2085
|
+
signal: AbortSignal;
|
|
2086
|
+
}): void;
|
|
2087
|
+
/**
|
|
2088
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2089
|
+
*/
|
|
2090
|
+
uniffiDestroy(): void;
|
|
2091
|
+
[Symbol.dispose]: () => void;
|
|
2092
|
+
static instanceOf(obj: any): obj is CompletionHandle;
|
|
2093
|
+
}
|
|
2094
|
+
export type ContextInterface = {
|
|
2095
|
+
/**
|
|
2096
|
+
* Get the deadline for this RPC call
|
|
2097
|
+
*/ deadline(): Date;
|
|
2098
|
+
/**
|
|
2099
|
+
* Check if the deadline has been exceeded
|
|
2100
|
+
*/ isDeadlineExceeded(): boolean;
|
|
2101
|
+
/**
|
|
2102
|
+
* Get the rpc session metadata
|
|
2103
|
+
*/ metadata(): Map<string, string>;
|
|
2104
|
+
/**
|
|
2105
|
+
* Get the remaining time until deadline
|
|
2106
|
+
*
|
|
2107
|
+
* Returns Duration::ZERO if the deadline has already passed
|
|
2108
|
+
*/ remainingTime(): number;
|
|
2109
|
+
/**
|
|
2110
|
+
* Get the session ID
|
|
2111
|
+
*/ sessionId(): string;
|
|
2112
|
+
};
|
|
2113
|
+
/**
|
|
2114
|
+
* Context passed to RPC handlers
|
|
2115
|
+
*
|
|
2116
|
+
* Contains all contextual information about an RPC call including:
|
|
2117
|
+
* - Session information (source, destination, session ID)
|
|
2118
|
+
* - Metadata (key-value pairs)
|
|
2119
|
+
* - Deadline/timeout information
|
|
2120
|
+
* - Message routing details
|
|
2121
|
+
*/
|
|
2122
|
+
export declare class Context extends UniffiAbstractObject implements ContextInterface {
|
|
2123
|
+
readonly [uniffiTypeNameSymbol]: "Context";
|
|
2124
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2125
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2126
|
+
/**
|
|
2127
|
+
* Get the deadline for this RPC call
|
|
2128
|
+
*/ deadline(): Date;
|
|
2129
|
+
/**
|
|
2130
|
+
* Check if the deadline has been exceeded
|
|
2131
|
+
*/ isDeadlineExceeded(): boolean;
|
|
2132
|
+
/**
|
|
2133
|
+
* Get the rpc session metadata
|
|
2134
|
+
*/ metadata(): Map<string, string>;
|
|
2135
|
+
/**
|
|
2136
|
+
* Get the remaining time until deadline
|
|
2137
|
+
*
|
|
2138
|
+
* Returns Duration::ZERO if the deadline has already passed
|
|
2139
|
+
*/ remainingTime(): number;
|
|
2140
|
+
/**
|
|
2141
|
+
* Get the session ID
|
|
2142
|
+
*/ sessionId(): string;
|
|
2143
|
+
/**
|
|
2144
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2145
|
+
*/
|
|
2146
|
+
uniffiDestroy(): void;
|
|
2147
|
+
[Symbol.dispose]: () => void;
|
|
2148
|
+
static instanceOf(obj: any): obj is Context;
|
|
2149
|
+
}
|
|
2150
|
+
export type NameInterface = {
|
|
2151
|
+
/**
|
|
2152
|
+
* Get the name components as a vector of strings
|
|
2153
|
+
*/ components(): Array<string>;
|
|
2154
|
+
/**
|
|
2155
|
+
* Get the name ID
|
|
2156
|
+
*/ id(): bigint;
|
|
2157
|
+
};
|
|
2158
|
+
/**
|
|
2159
|
+
* Name type for SLIM (Secure Low-Latency Interactive Messaging)
|
|
2160
|
+
*/
|
|
2161
|
+
export declare class Name extends UniffiAbstractObject implements NameInterface {
|
|
2162
|
+
readonly [uniffiTypeNameSymbol]: "Name";
|
|
2163
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2164
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2165
|
+
/**
|
|
2166
|
+
* Create a new Name from components without an ID
|
|
2167
|
+
*/
|
|
2168
|
+
constructor(component0: string, component1: string, component2: string);
|
|
2169
|
+
/**
|
|
2170
|
+
* Create a new Name from components with an ID
|
|
2171
|
+
*/
|
|
2172
|
+
static newWithId(component0: string, component1: string, component2: string, id: bigint): Name;
|
|
2173
|
+
/**
|
|
2174
|
+
* Get the name components as a vector of strings
|
|
2175
|
+
*/ components(): Array<string>;
|
|
2176
|
+
/**
|
|
2177
|
+
* Get the name ID
|
|
2178
|
+
*/ id(): bigint;
|
|
2179
|
+
/**
|
|
2180
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2181
|
+
*/
|
|
2182
|
+
uniffiDestroy(): void;
|
|
2183
|
+
[Symbol.dispose]: () => void;
|
|
2184
|
+
static instanceOf(obj: any): obj is Name;
|
|
2185
|
+
}
|
|
2186
|
+
export type RequestStreamInterface = {
|
|
2187
|
+
/**
|
|
2188
|
+
* Pull the next message from the stream (blocking version)
|
|
2189
|
+
*
|
|
2190
|
+
* Returns a StreamMessage indicating the result
|
|
2191
|
+
*/ next(): StreamMessage;
|
|
2192
|
+
/**
|
|
2193
|
+
* Pull the next message from the stream (async version)
|
|
2194
|
+
*
|
|
2195
|
+
* Returns a StreamMessage indicating the result
|
|
2196
|
+
*/ nextAsync(asyncOpts_?: {
|
|
2197
|
+
signal: AbortSignal;
|
|
2198
|
+
}): Promise<StreamMessage>;
|
|
2199
|
+
};
|
|
2200
|
+
/**
|
|
2201
|
+
* Request stream reader
|
|
2202
|
+
*
|
|
2203
|
+
* Allows pulling messages from a client request stream.
|
|
2204
|
+
* This wraps the underlying async stream and provides a blocking interface
|
|
2205
|
+
* suitable for UniFFI callback traits.
|
|
2206
|
+
*/
|
|
2207
|
+
export declare class RequestStream extends UniffiAbstractObject implements RequestStreamInterface {
|
|
2208
|
+
readonly [uniffiTypeNameSymbol]: "RequestStream";
|
|
2209
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2210
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2211
|
+
/**
|
|
2212
|
+
* Pull the next message from the stream (blocking version)
|
|
2213
|
+
*
|
|
2214
|
+
* Returns a StreamMessage indicating the result
|
|
2215
|
+
*/ next(): StreamMessage;
|
|
2216
|
+
/**
|
|
2217
|
+
* Pull the next message from the stream (async version)
|
|
2218
|
+
*
|
|
2219
|
+
* Returns a StreamMessage indicating the result
|
|
2220
|
+
*/ nextAsync(asyncOpts_?: {
|
|
2221
|
+
signal: AbortSignal;
|
|
2222
|
+
}): Promise<StreamMessage>;
|
|
2223
|
+
/**
|
|
2224
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2225
|
+
*/
|
|
2226
|
+
uniffiDestroy(): void;
|
|
2227
|
+
[Symbol.dispose]: () => void;
|
|
2228
|
+
static instanceOf(obj: any): obj is RequestStream;
|
|
2229
|
+
}
|
|
2230
|
+
export type RequestStreamWriterInterface = {
|
|
2231
|
+
/**
|
|
2232
|
+
* Finalize the stream and get the response (blocking version)
|
|
2233
|
+
*/ finalize(): ArrayBuffer;
|
|
2234
|
+
/**
|
|
2235
|
+
* Finalize the stream and get the response (async version)
|
|
2236
|
+
*/ finalizeAsync(asyncOpts_?: {
|
|
2237
|
+
signal: AbortSignal;
|
|
2238
|
+
}): Promise<ArrayBuffer>;
|
|
2239
|
+
/**
|
|
2240
|
+
* Send a request message to the stream (blocking version)
|
|
2241
|
+
*/ send(data: ArrayBuffer): void;
|
|
2242
|
+
/**
|
|
2243
|
+
* Send a request message to the stream (async version)
|
|
2244
|
+
*/ sendAsync(data: ArrayBuffer, asyncOpts_?: {
|
|
2245
|
+
signal: AbortSignal;
|
|
2246
|
+
}): void;
|
|
2247
|
+
};
|
|
2248
|
+
/**
|
|
2249
|
+
* Request stream writer for stream-to-unary RPC calls
|
|
2250
|
+
*
|
|
2251
|
+
* Allows sending multiple request messages and getting a final response.
|
|
2252
|
+
*/
|
|
2253
|
+
export declare class RequestStreamWriter extends UniffiAbstractObject implements RequestStreamWriterInterface {
|
|
2254
|
+
readonly [uniffiTypeNameSymbol]: "RequestStreamWriter";
|
|
2255
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2256
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2257
|
+
/**
|
|
2258
|
+
* Finalize the stream and get the response (blocking version)
|
|
2259
|
+
*/ finalize(): ArrayBuffer;
|
|
2260
|
+
/**
|
|
2261
|
+
* Finalize the stream and get the response (async version)
|
|
2262
|
+
*/ finalizeAsync(asyncOpts_?: {
|
|
2263
|
+
signal: AbortSignal;
|
|
2264
|
+
}): Promise<ArrayBuffer>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Send a request message to the stream (blocking version)
|
|
2267
|
+
*/ send(data: ArrayBuffer): void;
|
|
2268
|
+
/**
|
|
2269
|
+
* Send a request message to the stream (async version)
|
|
2270
|
+
*/ sendAsync(data: ArrayBuffer, asyncOpts_?: {
|
|
2271
|
+
signal: AbortSignal;
|
|
2272
|
+
}): void;
|
|
2273
|
+
/**
|
|
2274
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2275
|
+
*/
|
|
2276
|
+
uniffiDestroy(): void;
|
|
2277
|
+
[Symbol.dispose]: () => void;
|
|
2278
|
+
static instanceOf(obj: any): obj is RequestStreamWriter;
|
|
2279
|
+
}
|
|
2280
|
+
export type ResponseSinkInterface = {
|
|
2281
|
+
/**
|
|
2282
|
+
* Close the response stream (blocking version)
|
|
2283
|
+
*
|
|
2284
|
+
* Signals that no more messages will be sent.
|
|
2285
|
+
* The stream will end gracefully.
|
|
2286
|
+
*/ close(): void;
|
|
2287
|
+
/**
|
|
2288
|
+
* Close the response stream (async version)
|
|
2289
|
+
*
|
|
2290
|
+
* Signals that no more messages will be sent.
|
|
2291
|
+
* The stream will end gracefully.
|
|
2292
|
+
*/ closeAsync(asyncOpts_?: {
|
|
2293
|
+
signal: AbortSignal;
|
|
2294
|
+
}): void;
|
|
2295
|
+
/**
|
|
2296
|
+
* Check if the sink has been closed (blocking version)
|
|
2297
|
+
*/ isClosed(): boolean;
|
|
2298
|
+
/**
|
|
2299
|
+
* Check if the sink has been closed (async version)
|
|
2300
|
+
*/ isClosedAsync(asyncOpts_?: {
|
|
2301
|
+
signal: AbortSignal;
|
|
2302
|
+
}): Promise<boolean>;
|
|
2303
|
+
/**
|
|
2304
|
+
* Send a message to the response stream (blocking version)
|
|
2305
|
+
*
|
|
2306
|
+
* Returns an error if the stream has been closed or if sending fails.
|
|
2307
|
+
*/ send(data: ArrayBuffer): void;
|
|
2308
|
+
/**
|
|
2309
|
+
* Send a message to the response stream (async version)
|
|
2310
|
+
*
|
|
2311
|
+
* Returns an error if the stream has been closed or if sending fails.
|
|
2312
|
+
*/ sendAsync(data: ArrayBuffer, asyncOpts_?: {
|
|
2313
|
+
signal: AbortSignal;
|
|
2314
|
+
}): void;
|
|
2315
|
+
/**
|
|
2316
|
+
* Send an error to the response stream and close it (blocking version)
|
|
2317
|
+
*
|
|
2318
|
+
* This terminates the stream with an error status.
|
|
2319
|
+
*/ sendError(error: RpcError): void;
|
|
2320
|
+
/**
|
|
2321
|
+
* Send an error to the response stream and close it (async version)
|
|
2322
|
+
*
|
|
2323
|
+
* This terminates the stream with an error status.
|
|
2324
|
+
*/ sendErrorAsync(error: RpcError, asyncOpts_?: {
|
|
2325
|
+
signal: AbortSignal;
|
|
2326
|
+
}): void;
|
|
2327
|
+
};
|
|
2328
|
+
/**
|
|
2329
|
+
* Response stream writer
|
|
2330
|
+
*
|
|
2331
|
+
* Allows pushing messages to a client response stream.
|
|
2332
|
+
* This wraps an async channel sender and provides a blocking interface
|
|
2333
|
+
* suitable for UniFFI callback traits.
|
|
2334
|
+
*/
|
|
2335
|
+
export declare class ResponseSink extends UniffiAbstractObject implements ResponseSinkInterface {
|
|
2336
|
+
readonly [uniffiTypeNameSymbol]: "ResponseSink";
|
|
2337
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2338
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2339
|
+
/**
|
|
2340
|
+
* Close the response stream (blocking version)
|
|
2341
|
+
*
|
|
2342
|
+
* Signals that no more messages will be sent.
|
|
2343
|
+
* The stream will end gracefully.
|
|
2344
|
+
*/ close(): void;
|
|
2345
|
+
/**
|
|
2346
|
+
* Close the response stream (async version)
|
|
2347
|
+
*
|
|
2348
|
+
* Signals that no more messages will be sent.
|
|
2349
|
+
* The stream will end gracefully.
|
|
2350
|
+
*/ closeAsync(asyncOpts_?: {
|
|
2351
|
+
signal: AbortSignal;
|
|
2352
|
+
}): void;
|
|
2353
|
+
/**
|
|
2354
|
+
* Check if the sink has been closed (blocking version)
|
|
2355
|
+
*/ isClosed(): boolean;
|
|
2356
|
+
/**
|
|
2357
|
+
* Check if the sink has been closed (async version)
|
|
2358
|
+
*/ isClosedAsync(asyncOpts_?: {
|
|
2359
|
+
signal: AbortSignal;
|
|
2360
|
+
}): Promise<boolean>;
|
|
2361
|
+
/**
|
|
2362
|
+
* Send a message to the response stream (blocking version)
|
|
2363
|
+
*
|
|
2364
|
+
* Returns an error if the stream has been closed or if sending fails.
|
|
2365
|
+
*/ send(data: ArrayBuffer): void;
|
|
2366
|
+
/**
|
|
2367
|
+
* Send a message to the response stream (async version)
|
|
2368
|
+
*
|
|
2369
|
+
* Returns an error if the stream has been closed or if sending fails.
|
|
2370
|
+
*/ sendAsync(data: ArrayBuffer, asyncOpts_?: {
|
|
2371
|
+
signal: AbortSignal;
|
|
2372
|
+
}): void;
|
|
2373
|
+
/**
|
|
2374
|
+
* Send an error to the response stream and close it (blocking version)
|
|
2375
|
+
*
|
|
2376
|
+
* This terminates the stream with an error status.
|
|
2377
|
+
*/ sendError(error: RpcError): void;
|
|
2378
|
+
/**
|
|
2379
|
+
* Send an error to the response stream and close it (async version)
|
|
2380
|
+
*
|
|
2381
|
+
* This terminates the stream with an error status.
|
|
2382
|
+
*/ sendErrorAsync(error: RpcError, asyncOpts_?: {
|
|
2383
|
+
signal: AbortSignal;
|
|
2384
|
+
}): void;
|
|
2385
|
+
/**
|
|
2386
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2387
|
+
*/
|
|
2388
|
+
uniffiDestroy(): void;
|
|
2389
|
+
[Symbol.dispose]: () => void;
|
|
2390
|
+
static instanceOf(obj: any): obj is ResponseSink;
|
|
2391
|
+
}
|
|
2392
|
+
export type ResponseStreamReaderInterface = {
|
|
2393
|
+
/**
|
|
2394
|
+
* Pull the next message from the response stream (blocking version)
|
|
2395
|
+
*
|
|
2396
|
+
* Returns a StreamMessage indicating the result
|
|
2397
|
+
*/ next(): StreamMessage;
|
|
2398
|
+
/**
|
|
2399
|
+
* Pull the next message from the response stream (async version)
|
|
2400
|
+
*
|
|
2401
|
+
* Returns a StreamMessage indicating the result
|
|
2402
|
+
*/ nextAsync(asyncOpts_?: {
|
|
2403
|
+
signal: AbortSignal;
|
|
2404
|
+
}): Promise<StreamMessage>;
|
|
2405
|
+
};
|
|
2406
|
+
/**
|
|
2407
|
+
* Response stream reader for unary-to-stream RPC calls
|
|
2408
|
+
*
|
|
2409
|
+
* Allows pulling messages from a server response stream one at a time.
|
|
2410
|
+
*/
|
|
2411
|
+
export declare class ResponseStreamReader extends UniffiAbstractObject implements ResponseStreamReaderInterface {
|
|
2412
|
+
readonly [uniffiTypeNameSymbol]: "ResponseStreamReader";
|
|
2413
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2414
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2415
|
+
/**
|
|
2416
|
+
* Pull the next message from the response stream (blocking version)
|
|
2417
|
+
*
|
|
2418
|
+
* Returns a StreamMessage indicating the result
|
|
2419
|
+
*/ next(): StreamMessage;
|
|
2420
|
+
/**
|
|
2421
|
+
* Pull the next message from the response stream (async version)
|
|
2422
|
+
*
|
|
2423
|
+
* Returns a StreamMessage indicating the result
|
|
2424
|
+
*/ nextAsync(asyncOpts_?: {
|
|
2425
|
+
signal: AbortSignal;
|
|
2426
|
+
}): Promise<StreamMessage>;
|
|
2427
|
+
/**
|
|
2428
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2429
|
+
*/
|
|
2430
|
+
uniffiDestroy(): void;
|
|
2431
|
+
[Symbol.dispose]: () => void;
|
|
2432
|
+
static instanceOf(obj: any): obj is ResponseStreamReader;
|
|
2433
|
+
}
|
|
2434
|
+
export type ServerInterface = {
|
|
2435
|
+
/**
|
|
2436
|
+
* Register a stream-to-stream RPC handler
|
|
2437
|
+
*
|
|
2438
|
+
* # Arguments
|
|
2439
|
+
* * `service_name` - The service name
|
|
2440
|
+
* * `method_name` - The method name
|
|
2441
|
+
* * `handler` - Implementation of the StreamStreamHandler trait
|
|
2442
|
+
*/ registerStreamStream(serviceName: string, methodName: string, handler: StreamStreamHandler): void;
|
|
2443
|
+
/**
|
|
2444
|
+
* Register a stream-to-unary RPC handler
|
|
2445
|
+
*
|
|
2446
|
+
* # Arguments
|
|
2447
|
+
* * `service_name` - The service name
|
|
2448
|
+
* * `method_name` - The method name
|
|
2449
|
+
* * `handler` - Implementation of the StreamUnaryHandler trait
|
|
2450
|
+
*/ registerStreamUnary(serviceName: string, methodName: string, handler: StreamUnaryHandler): void;
|
|
2451
|
+
/**
|
|
2452
|
+
* Register a unary-to-stream RPC handler
|
|
2453
|
+
*
|
|
2454
|
+
* # Arguments
|
|
2455
|
+
* * `service_name` - The service name
|
|
2456
|
+
* * `method_name` - The method name
|
|
2457
|
+
* * `handler` - Implementation of the UnaryStreamHandler trait
|
|
2458
|
+
*/ registerUnaryStream(serviceName: string, methodName: string, handler: UnaryStreamHandler): void;
|
|
2459
|
+
/**
|
|
2460
|
+
* Register a unary-to-unary RPC handler
|
|
2461
|
+
*
|
|
2462
|
+
* # Arguments
|
|
2463
|
+
* * `service_name` - The service name (e.g., "MyService")
|
|
2464
|
+
* * `method_name` - The method name (e.g., "GetUser")
|
|
2465
|
+
* * `handler` - Implementation of the UnaryUnaryHandler trait
|
|
2466
|
+
*/ registerUnaryUnary(serviceName: string, methodName: string, handler: UnaryUnaryHandler): void;
|
|
2467
|
+
/**
|
|
2468
|
+
* Start serving RPC requests (blocking version)
|
|
2469
|
+
*
|
|
2470
|
+
* This is a blocking method that runs until the server is shut down.
|
|
2471
|
+
* It listens for incoming RPC calls and dispatches them to registered handlers.
|
|
2472
|
+
*/ serve(): void;
|
|
2473
|
+
/**
|
|
2474
|
+
* Start serving RPC requests (async version)
|
|
2475
|
+
*
|
|
2476
|
+
* This is an async method that runs until the server is shut down.
|
|
2477
|
+
* It listens for incoming RPC calls and dispatches them to registered handlers.
|
|
2478
|
+
*/ serveAsync(asyncOpts_?: {
|
|
2479
|
+
signal: AbortSignal;
|
|
2480
|
+
}): void;
|
|
2481
|
+
/**
|
|
2482
|
+
* Shutdown the server gracefully (blocking version)
|
|
2483
|
+
*
|
|
2484
|
+
* This signals the server to stop accepting new requests and wait for
|
|
2485
|
+
* in-flight requests to complete.
|
|
2486
|
+
*/ shutdown(): void;
|
|
2487
|
+
/**
|
|
2488
|
+
* Shutdown the server gracefully (async version)
|
|
2489
|
+
*
|
|
2490
|
+
* This signals the server to stop accepting new requests and wait for
|
|
2491
|
+
* in-flight requests to complete.
|
|
2492
|
+
*/ shutdownAsync(asyncOpts_?: {
|
|
2493
|
+
signal: AbortSignal;
|
|
2494
|
+
}): void;
|
|
2495
|
+
};
|
|
2496
|
+
/**
|
|
2497
|
+
* RPC Server
|
|
2498
|
+
*
|
|
2499
|
+
* Handles incoming RPC requests by creating sessions and dispatching
|
|
2500
|
+
* to registered service handlers.
|
|
2501
|
+
*
|
|
2502
|
+
* # Example
|
|
2503
|
+
*
|
|
2504
|
+
* ```no_run
|
|
2505
|
+
* # use slim_bindings::{Server, Context, Status, Decoder, Encoder, App, Name};
|
|
2506
|
+
* # use std::sync::Arc;
|
|
2507
|
+
* # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
2508
|
+
* # use slim_bindings::{IdentityProviderConfig, IdentityVerifierConfig};
|
|
2509
|
+
* # let app_name = Arc::new(Name::new("test".to_string(), "app".to_string(), "v1".to_string()));
|
|
2510
|
+
* # let provider = IdentityProviderConfig::SharedSecret { id: "test".to_string(), data: "secret".to_string() };
|
|
2511
|
+
* # let verifier = IdentityVerifierConfig::SharedSecret { id: "test".to_string(), data: "secret".to_string() };
|
|
2512
|
+
* # let app = App::new(app_name, provider, verifier)?;
|
|
2513
|
+
* # let core_app = app.inner();
|
|
2514
|
+
* # let notification_rx = app.notification_receiver();
|
|
2515
|
+
* # #[derive(Default)]
|
|
2516
|
+
* # struct Request {}
|
|
2517
|
+
* # impl Decoder for Request {
|
|
2518
|
+
* # fn decode(_buf: impl Into<Vec<u8>>) -> Result<Self, Status> { Ok(Request::default()) }
|
|
2519
|
+
* # }
|
|
2520
|
+
* # #[derive(Default)]
|
|
2521
|
+
* # struct Response {}
|
|
2522
|
+
* # impl Encoder for Response {
|
|
2523
|
+
* # fn encode(self) -> Result<Vec<u8>, Status> { Ok(vec![]) }
|
|
2524
|
+
* # }
|
|
2525
|
+
* let base_name = Name::new("org".to_string(), "namespace".to_string(), "service".to_string());
|
|
2526
|
+
* let server = Server::new_with_shared_rx_and_connection(core_app, base_name.as_slim_name(), None, notification_rx, None);
|
|
2527
|
+
*
|
|
2528
|
+
* // Register handlers
|
|
2529
|
+
* server.register_unary_unary_internal(
|
|
2530
|
+
* "MyService",
|
|
2531
|
+
* "MyMethod",
|
|
2532
|
+
* |request: Request, _ctx: Context| async move {
|
|
2533
|
+
* Ok(Response::default())
|
|
2534
|
+
* }
|
|
2535
|
+
* );
|
|
2536
|
+
* # Ok(())
|
|
2537
|
+
* # }
|
|
2538
|
+
* ```
|
|
2539
|
+
*/
|
|
2540
|
+
export declare class Server extends UniffiAbstractObject implements ServerInterface {
|
|
2541
|
+
readonly [uniffiTypeNameSymbol]: "Server";
|
|
2542
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2543
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2544
|
+
/**
|
|
2545
|
+
* Create a new RPC server
|
|
2546
|
+
*
|
|
2547
|
+
* This is the primary constructor for creating an RPC server instance
|
|
2548
|
+
* that can handle incoming RPC requests over SLIM.
|
|
2549
|
+
*
|
|
2550
|
+
* # Arguments
|
|
2551
|
+
* * `app` - The SLIM application instance that provides the underlying
|
|
2552
|
+
* network transport and session management
|
|
2553
|
+
* * `base_name` - The base name for this service (e.g., org.namespace.service).
|
|
2554
|
+
* This name is used to construct subscription names for RPC methods.
|
|
2555
|
+
*
|
|
2556
|
+
* # Returns
|
|
2557
|
+
* A new RPC server instance wrapped in an Arc for shared ownership
|
|
2558
|
+
*/
|
|
2559
|
+
constructor(app: App, baseName: Name);
|
|
2560
|
+
/**
|
|
2561
|
+
* Create a new RPC server with optional connection ID
|
|
2562
|
+
*
|
|
2563
|
+
* The connection ID is used to set up routing before serving RPC requests,
|
|
2564
|
+
* enabling multi-hop RPC calls through specific connections.
|
|
2565
|
+
*
|
|
2566
|
+
* # Arguments
|
|
2567
|
+
* * `app` - The SLIM application instance that provides the underlying
|
|
2568
|
+
* network transport and session management
|
|
2569
|
+
* * `base_name` - The base name for this service (e.g., org.namespace.service).
|
|
2570
|
+
* This name is used to construct subscription names for RPC methods.
|
|
2571
|
+
* * `connection_id` - Optional connection ID for routing setup
|
|
2572
|
+
*
|
|
2573
|
+
* # Returns
|
|
2574
|
+
* A new RPC server instance wrapped in an Arc for shared ownership
|
|
2575
|
+
*/
|
|
2576
|
+
static newWithConnection(app: App, baseName: Name, connectionId: /*u64*/ bigint | undefined): Server;
|
|
2577
|
+
/**
|
|
2578
|
+
* Register a stream-to-stream RPC handler
|
|
2579
|
+
*
|
|
2580
|
+
* # Arguments
|
|
2581
|
+
* * `service_name` - The service name
|
|
2582
|
+
* * `method_name` - The method name
|
|
2583
|
+
* * `handler` - Implementation of the StreamStreamHandler trait
|
|
2584
|
+
*/ registerStreamStream(serviceName: string, methodName: string, handler: StreamStreamHandler): void;
|
|
2585
|
+
/**
|
|
2586
|
+
* Register a stream-to-unary RPC handler
|
|
2587
|
+
*
|
|
2588
|
+
* # Arguments
|
|
2589
|
+
* * `service_name` - The service name
|
|
2590
|
+
* * `method_name` - The method name
|
|
2591
|
+
* * `handler` - Implementation of the StreamUnaryHandler trait
|
|
2592
|
+
*/ registerStreamUnary(serviceName: string, methodName: string, handler: StreamUnaryHandler): void;
|
|
2593
|
+
/**
|
|
2594
|
+
* Register a unary-to-stream RPC handler
|
|
2595
|
+
*
|
|
2596
|
+
* # Arguments
|
|
2597
|
+
* * `service_name` - The service name
|
|
2598
|
+
* * `method_name` - The method name
|
|
2599
|
+
* * `handler` - Implementation of the UnaryStreamHandler trait
|
|
2600
|
+
*/ registerUnaryStream(serviceName: string, methodName: string, handler: UnaryStreamHandler): void;
|
|
2601
|
+
/**
|
|
2602
|
+
* Register a unary-to-unary RPC handler
|
|
2603
|
+
*
|
|
2604
|
+
* # Arguments
|
|
2605
|
+
* * `service_name` - The service name (e.g., "MyService")
|
|
2606
|
+
* * `method_name` - The method name (e.g., "GetUser")
|
|
2607
|
+
* * `handler` - Implementation of the UnaryUnaryHandler trait
|
|
2608
|
+
*/ registerUnaryUnary(serviceName: string, methodName: string, handler: UnaryUnaryHandler): void;
|
|
2609
|
+
/**
|
|
2610
|
+
* Start serving RPC requests (blocking version)
|
|
2611
|
+
*
|
|
2612
|
+
* This is a blocking method that runs until the server is shut down.
|
|
2613
|
+
* It listens for incoming RPC calls and dispatches them to registered handlers.
|
|
2614
|
+
*/ serve(): void;
|
|
2615
|
+
/**
|
|
2616
|
+
* Start serving RPC requests (async version)
|
|
2617
|
+
*
|
|
2618
|
+
* This is an async method that runs until the server is shut down.
|
|
2619
|
+
* It listens for incoming RPC calls and dispatches them to registered handlers.
|
|
2620
|
+
*/ serveAsync(asyncOpts_?: {
|
|
2621
|
+
signal: AbortSignal;
|
|
2622
|
+
}): void;
|
|
2623
|
+
/**
|
|
2624
|
+
* Shutdown the server gracefully (blocking version)
|
|
2625
|
+
*
|
|
2626
|
+
* This signals the server to stop accepting new requests and wait for
|
|
2627
|
+
* in-flight requests to complete.
|
|
2628
|
+
*/ shutdown(): void;
|
|
2629
|
+
/**
|
|
2630
|
+
* Shutdown the server gracefully (async version)
|
|
2631
|
+
*
|
|
2632
|
+
* This signals the server to stop accepting new requests and wait for
|
|
2633
|
+
* in-flight requests to complete.
|
|
2634
|
+
*/ shutdownAsync(asyncOpts_?: {
|
|
2635
|
+
signal: AbortSignal;
|
|
2636
|
+
}): void;
|
|
2637
|
+
/**
|
|
2638
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2639
|
+
*/
|
|
2640
|
+
uniffiDestroy(): void;
|
|
2641
|
+
[Symbol.dispose]: () => void;
|
|
2642
|
+
static instanceOf(obj: any): obj is Server;
|
|
2643
|
+
}
|
|
2644
|
+
export type ServiceInterface = {
|
|
2645
|
+
/**
|
|
2646
|
+
* Get the service configuration
|
|
2647
|
+
*/ config(): ServiceConfig;
|
|
2648
|
+
/**
|
|
2649
|
+
* Connect to a remote endpoint as a client - blocking version
|
|
2650
|
+
*/ connect(config: ClientConfig): bigint;
|
|
2651
|
+
/**
|
|
2652
|
+
* Connect to a remote endpoint as a client
|
|
2653
|
+
*/ connectAsync(config: ClientConfig, asyncOpts_?: {
|
|
2654
|
+
signal: AbortSignal;
|
|
2655
|
+
}): Promise</*u64*/ bigint>;
|
|
2656
|
+
/**
|
|
2657
|
+
* Create a new App with authentication configuration (blocking version)
|
|
2658
|
+
*
|
|
2659
|
+
* This method initializes authentication providers/verifiers and creates a App
|
|
2660
|
+
* on this service instance. This is a blocking wrapper around create_app_async.
|
|
2661
|
+
*
|
|
2662
|
+
* # Arguments
|
|
2663
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2664
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2665
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2666
|
+
*
|
|
2667
|
+
* # Returns
|
|
2668
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2669
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2670
|
+
*/ createApp(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig): App;
|
|
2671
|
+
/**
|
|
2672
|
+
* Create a new App with authentication configuration (async version)
|
|
2673
|
+
*
|
|
2674
|
+
* This method initializes authentication providers/verifiers and creates a App
|
|
2675
|
+
* on this service instance.
|
|
2676
|
+
*
|
|
2677
|
+
* # Arguments
|
|
2678
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2679
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2680
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2681
|
+
*
|
|
2682
|
+
* # Returns
|
|
2683
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2684
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2685
|
+
*/ createAppAsync(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, asyncOpts_?: {
|
|
2686
|
+
signal: AbortSignal;
|
|
2687
|
+
}): Promise<App>;
|
|
2688
|
+
/**
|
|
2689
|
+
* Create a new App with authentication configuration and traffic direction (blocking version)
|
|
2690
|
+
*
|
|
2691
|
+
* This method initializes authentication providers/verifiers and creates an App
|
|
2692
|
+
* on this service instance. The direction parameter controls whether the app
|
|
2693
|
+
* can send messages, receive messages, both, or neither.
|
|
2694
|
+
*
|
|
2695
|
+
* # Arguments
|
|
2696
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2697
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2698
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2699
|
+
* * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
|
|
2700
|
+
*
|
|
2701
|
+
* # Returns
|
|
2702
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2703
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2704
|
+
*/ createAppWithDirection(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): App;
|
|
2705
|
+
/**
|
|
2706
|
+
* Create a new App with authentication configuration and traffic direction (async version)
|
|
2707
|
+
*
|
|
2708
|
+
* This method initializes authentication providers/verifiers and creates an App
|
|
2709
|
+
* on this service instance. The direction parameter controls whether the app
|
|
2710
|
+
* can send messages, receive messages, both, or neither.
|
|
2711
|
+
*
|
|
2712
|
+
* # Arguments
|
|
2713
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2714
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2715
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2716
|
+
* * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
|
|
2717
|
+
*
|
|
2718
|
+
* # Returns
|
|
2719
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2720
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2721
|
+
*/ createAppWithDirectionAsync(name: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, asyncOpts_?: {
|
|
2722
|
+
signal: AbortSignal;
|
|
2723
|
+
}): Promise<App>;
|
|
2724
|
+
/**
|
|
2725
|
+
* Create a new App with SharedSecret authentication (helper function)
|
|
2726
|
+
*
|
|
2727
|
+
* This is a convenience function for creating a SLIM application using SharedSecret authentication
|
|
2728
|
+
* on this service instance.
|
|
2729
|
+
*
|
|
2730
|
+
* # Arguments
|
|
2731
|
+
* * `name` - The base name for the app (without ID)
|
|
2732
|
+
* * `secret` - The shared secret string for authentication
|
|
2733
|
+
*
|
|
2734
|
+
* # Returns
|
|
2735
|
+
* * `Ok(Arc<App>)` - Successfully created app
|
|
2736
|
+
* * `Err(SlimError)` - If app creation fails
|
|
2737
|
+
*/ createAppWithSecret(name: Name, secret: string): App;
|
|
2738
|
+
/**
|
|
2739
|
+
* Create a new App with SharedSecret authentication (async version)
|
|
2740
|
+
*
|
|
2741
|
+
* This is a convenience function for creating a SLIM application using SharedSecret authentication
|
|
2742
|
+
* on this service instance. This is the async version.
|
|
2743
|
+
*
|
|
2744
|
+
* # Arguments
|
|
2745
|
+
* * `name` - The base name for the app (without ID)
|
|
2746
|
+
* * `secret` - The shared secret string for authentication
|
|
2747
|
+
*
|
|
2748
|
+
* # Returns
|
|
2749
|
+
* * `Ok(Arc<App>)` - Successfully created app
|
|
2750
|
+
* * `Err(SlimError)` - If app creation fails
|
|
2751
|
+
*/ createAppWithSecretAsync(name: Name, secret: string, asyncOpts_?: {
|
|
2752
|
+
signal: AbortSignal;
|
|
2753
|
+
}): Promise<App>;
|
|
2754
|
+
/**
|
|
2755
|
+
* Disconnect a client connection by connection ID - blocking version
|
|
2756
|
+
*/ disconnect(connId: bigint): void;
|
|
2757
|
+
/**
|
|
2758
|
+
* Get the connection ID for a given endpoint
|
|
2759
|
+
*/ getConnectionId(endpoint: string): /*u64*/ bigint | undefined;
|
|
2760
|
+
/**
|
|
2761
|
+
* Get the service identifier/name
|
|
2762
|
+
*/ getName(): string;
|
|
2763
|
+
/**
|
|
2764
|
+
* Run the service (starts all configured servers and clients) - blocking version
|
|
2765
|
+
*/ run(): void;
|
|
2766
|
+
/**
|
|
2767
|
+
* Run the service (starts all configured servers and clients)
|
|
2768
|
+
*/ runAsync(asyncOpts_?: {
|
|
2769
|
+
signal: AbortSignal;
|
|
2770
|
+
}): void;
|
|
2771
|
+
/**
|
|
2772
|
+
* Start a server with the given configuration - blocking version
|
|
2773
|
+
*/ runServer(config: ServerConfig): void;
|
|
2774
|
+
/**
|
|
2775
|
+
* Start a server with the given configuration
|
|
2776
|
+
*/ runServerAsync(config: ServerConfig, asyncOpts_?: {
|
|
2777
|
+
signal: AbortSignal;
|
|
2778
|
+
}): void;
|
|
2779
|
+
/**
|
|
2780
|
+
* Shutdown the service gracefully - blocking version
|
|
2781
|
+
*/ shutdown(): void;
|
|
2782
|
+
/**
|
|
2783
|
+
* Shutdown the service gracefully
|
|
2784
|
+
*/ shutdownAsync(asyncOpts_?: {
|
|
2785
|
+
signal: AbortSignal;
|
|
2786
|
+
}): void;
|
|
2787
|
+
/**
|
|
2788
|
+
* Stop a server by endpoint - blocking version
|
|
2789
|
+
*/ stopServer(endpoint: string): void;
|
|
2790
|
+
};
|
|
2791
|
+
/**
|
|
2792
|
+
* Service wrapper for uniffi bindings
|
|
2793
|
+
*/
|
|
2794
|
+
export declare class Service extends UniffiAbstractObject implements ServiceInterface {
|
|
2795
|
+
readonly [uniffiTypeNameSymbol]: "Service";
|
|
2796
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
2797
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
2798
|
+
/**
|
|
2799
|
+
* Create a new Service with the given name
|
|
2800
|
+
*/
|
|
2801
|
+
constructor(name: string);
|
|
2802
|
+
/**
|
|
2803
|
+
* Create a new Service with configuration
|
|
2804
|
+
*/
|
|
2805
|
+
static newWithConfig(name: string, config: ServiceConfig): Service;
|
|
2806
|
+
/**
|
|
2807
|
+
* Get the service configuration
|
|
2808
|
+
*/ config(): ServiceConfig;
|
|
2809
|
+
/**
|
|
2810
|
+
* Connect to a remote endpoint as a client - blocking version
|
|
2811
|
+
*/ connect(config: ClientConfig): bigint;
|
|
2812
|
+
/**
|
|
2813
|
+
* Connect to a remote endpoint as a client
|
|
2814
|
+
*/ connectAsync(config: ClientConfig, asyncOpts_?: {
|
|
2815
|
+
signal: AbortSignal;
|
|
2816
|
+
}): Promise</*u64*/ bigint>;
|
|
2817
|
+
/**
|
|
2818
|
+
* Create a new App with authentication configuration (blocking version)
|
|
2819
|
+
*
|
|
2820
|
+
* This method initializes authentication providers/verifiers and creates a App
|
|
2821
|
+
* on this service instance. This is a blocking wrapper around create_app_async.
|
|
2822
|
+
*
|
|
2823
|
+
* # Arguments
|
|
2824
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2825
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2826
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2827
|
+
*
|
|
2828
|
+
* # Returns
|
|
2829
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2830
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2831
|
+
*/ createApp(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig): App;
|
|
2832
|
+
/**
|
|
2833
|
+
* Create a new App with authentication configuration (async version)
|
|
2834
|
+
*
|
|
2835
|
+
* This method initializes authentication providers/verifiers and creates a App
|
|
2836
|
+
* on this service instance.
|
|
2837
|
+
*
|
|
2838
|
+
* # Arguments
|
|
2839
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2840
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2841
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2842
|
+
*
|
|
2843
|
+
* # Returns
|
|
2844
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2845
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2846
|
+
*/ createAppAsync(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, asyncOpts_?: {
|
|
2847
|
+
signal: AbortSignal;
|
|
2848
|
+
}): Promise<App>;
|
|
2849
|
+
/**
|
|
2850
|
+
* Create a new App with authentication configuration and traffic direction (blocking version)
|
|
2851
|
+
*
|
|
2852
|
+
* This method initializes authentication providers/verifiers and creates an App
|
|
2853
|
+
* on this service instance. The direction parameter controls whether the app
|
|
2854
|
+
* can send messages, receive messages, both, or neither.
|
|
2855
|
+
*
|
|
2856
|
+
* # Arguments
|
|
2857
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2858
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2859
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2860
|
+
* * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
|
|
2861
|
+
*
|
|
2862
|
+
* # Returns
|
|
2863
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2864
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2865
|
+
*/ createAppWithDirection(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): App;
|
|
2866
|
+
/**
|
|
2867
|
+
* Create a new App with authentication configuration and traffic direction (async version)
|
|
2868
|
+
*
|
|
2869
|
+
* This method initializes authentication providers/verifiers and creates an App
|
|
2870
|
+
* on this service instance. The direction parameter controls whether the app
|
|
2871
|
+
* can send messages, receive messages, both, or neither.
|
|
2872
|
+
*
|
|
2873
|
+
* # Arguments
|
|
2874
|
+
* * `base_name` - The base name for the app (without ID)
|
|
2875
|
+
* * `identity_provider_config` - Configuration for proving identity to others
|
|
2876
|
+
* * `identity_verifier_config` - Configuration for verifying identity of others
|
|
2877
|
+
* * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
|
|
2878
|
+
*
|
|
2879
|
+
* # Returns
|
|
2880
|
+
* * `Ok(Arc<App>)` - Successfully created adapter
|
|
2881
|
+
* * `Err(SlimError)` - If adapter creation fails
|
|
2882
|
+
*/ createAppWithDirectionAsync(name: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, asyncOpts_?: {
|
|
2883
|
+
signal: AbortSignal;
|
|
2884
|
+
}): Promise<App>;
|
|
2885
|
+
/**
|
|
2886
|
+
* Create a new App with SharedSecret authentication (helper function)
|
|
2887
|
+
*
|
|
2888
|
+
* This is a convenience function for creating a SLIM application using SharedSecret authentication
|
|
2889
|
+
* on this service instance.
|
|
2890
|
+
*
|
|
2891
|
+
* # Arguments
|
|
2892
|
+
* * `name` - The base name for the app (without ID)
|
|
2893
|
+
* * `secret` - The shared secret string for authentication
|
|
2894
|
+
*
|
|
2895
|
+
* # Returns
|
|
2896
|
+
* * `Ok(Arc<App>)` - Successfully created app
|
|
2897
|
+
* * `Err(SlimError)` - If app creation fails
|
|
2898
|
+
*/ createAppWithSecret(name: Name, secret: string): App;
|
|
2899
|
+
/**
|
|
2900
|
+
* Create a new App with SharedSecret authentication (async version)
|
|
2901
|
+
*
|
|
2902
|
+
* This is a convenience function for creating a SLIM application using SharedSecret authentication
|
|
2903
|
+
* on this service instance. This is the async version.
|
|
2904
|
+
*
|
|
2905
|
+
* # Arguments
|
|
2906
|
+
* * `name` - The base name for the app (without ID)
|
|
2907
|
+
* * `secret` - The shared secret string for authentication
|
|
2908
|
+
*
|
|
2909
|
+
* # Returns
|
|
2910
|
+
* * `Ok(Arc<App>)` - Successfully created app
|
|
2911
|
+
* * `Err(SlimError)` - If app creation fails
|
|
2912
|
+
*/ createAppWithSecretAsync(name: Name, secret: string, asyncOpts_?: {
|
|
2913
|
+
signal: AbortSignal;
|
|
2914
|
+
}): Promise<App>;
|
|
2915
|
+
/**
|
|
2916
|
+
* Disconnect a client connection by connection ID - blocking version
|
|
2917
|
+
*/ disconnect(connId: bigint): void;
|
|
2918
|
+
/**
|
|
2919
|
+
* Get the connection ID for a given endpoint
|
|
2920
|
+
*/ getConnectionId(endpoint: string): /*u64*/ bigint | undefined;
|
|
2921
|
+
/**
|
|
2922
|
+
* Get the service identifier/name
|
|
2923
|
+
*/ getName(): string;
|
|
2924
|
+
/**
|
|
2925
|
+
* Run the service (starts all configured servers and clients) - blocking version
|
|
2926
|
+
*/ run(): void;
|
|
2927
|
+
/**
|
|
2928
|
+
* Run the service (starts all configured servers and clients)
|
|
2929
|
+
*/ runAsync(asyncOpts_?: {
|
|
2930
|
+
signal: AbortSignal;
|
|
2931
|
+
}): void;
|
|
2932
|
+
/**
|
|
2933
|
+
* Start a server with the given configuration - blocking version
|
|
2934
|
+
*/ runServer(config: ServerConfig): void;
|
|
2935
|
+
/**
|
|
2936
|
+
* Start a server with the given configuration
|
|
2937
|
+
*/ runServerAsync(config: ServerConfig, asyncOpts_?: {
|
|
2938
|
+
signal: AbortSignal;
|
|
2939
|
+
}): void;
|
|
2940
|
+
/**
|
|
2941
|
+
* Shutdown the service gracefully - blocking version
|
|
2942
|
+
*/ shutdown(): void;
|
|
2943
|
+
/**
|
|
2944
|
+
* Shutdown the service gracefully
|
|
2945
|
+
*/ shutdownAsync(asyncOpts_?: {
|
|
2946
|
+
signal: AbortSignal;
|
|
2947
|
+
}): void;
|
|
2948
|
+
/**
|
|
2949
|
+
* Stop a server by endpoint - blocking version
|
|
2950
|
+
*/ stopServer(endpoint: string): void;
|
|
2951
|
+
/**
|
|
2952
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
2953
|
+
*/
|
|
2954
|
+
uniffiDestroy(): void;
|
|
2955
|
+
[Symbol.dispose]: () => void;
|
|
2956
|
+
static instanceOf(obj: any): obj is Service;
|
|
2957
|
+
}
|
|
2958
|
+
export type SessionInterface = {
|
|
2959
|
+
/**
|
|
2960
|
+
* Get the session configuration
|
|
2961
|
+
*/ config(): SessionConfig;
|
|
2962
|
+
/**
|
|
2963
|
+
* Get the destination name for this session
|
|
2964
|
+
*/ destination(): Name;
|
|
2965
|
+
/**
|
|
2966
|
+
* Receive a message from the session (blocking version for FFI)
|
|
2967
|
+
*
|
|
2968
|
+
* # Arguments
|
|
2969
|
+
* * `timeout` - Optional timeout duration
|
|
2970
|
+
*
|
|
2971
|
+
* # Returns
|
|
2972
|
+
* * `Ok(ReceivedMessage)` - Message with context and payload bytes
|
|
2973
|
+
* * `Err(SlimError)` - If the receive fails or times out
|
|
2974
|
+
*/ getMessage(timeout: number | undefined): ReceivedMessage;
|
|
2975
|
+
/**
|
|
2976
|
+
* Receive a message from the session (async version)
|
|
2977
|
+
*/ getMessageAsync(timeout: number | undefined, asyncOpts_?: {
|
|
2978
|
+
signal: AbortSignal;
|
|
2979
|
+
}): Promise<ReceivedMessage>;
|
|
2980
|
+
/**
|
|
2981
|
+
* Invite a participant to the session (blocking version)
|
|
2982
|
+
*
|
|
2983
|
+
* Returns a completion handle that can be awaited to ensure the invitation completes.
|
|
2984
|
+
*/ invite(participant: Name): CompletionHandle;
|
|
2985
|
+
/**
|
|
2986
|
+
* Invite a participant and wait for completion (blocking version)
|
|
2987
|
+
*
|
|
2988
|
+
* This method invites a participant and blocks until the invitation completes.
|
|
2989
|
+
*/ inviteAndWait(participant: Name): void;
|
|
2990
|
+
/**
|
|
2991
|
+
* Invite a participant and wait for completion (async version)
|
|
2992
|
+
*
|
|
2993
|
+
* This method invites a participant and waits until the invitation completes.
|
|
2994
|
+
*/ inviteAndWaitAsync(participant: Name, asyncOpts_?: {
|
|
2995
|
+
signal: AbortSignal;
|
|
2996
|
+
}): void;
|
|
2997
|
+
/**
|
|
2998
|
+
* Invite a participant to the session (async version)
|
|
2999
|
+
*
|
|
3000
|
+
* Returns a completion handle that can be awaited to ensure the invitation completes.
|
|
3001
|
+
*/ inviteAsync(participant: Name, asyncOpts_?: {
|
|
3002
|
+
signal: AbortSignal;
|
|
3003
|
+
}): Promise<CompletionHandle>;
|
|
3004
|
+
/**
|
|
3005
|
+
* Check if this session is the initiator
|
|
3006
|
+
*/ isInitiator(): boolean;
|
|
3007
|
+
/**
|
|
3008
|
+
* Get the session metadata
|
|
3009
|
+
*/ metadata(): Map<string, string>;
|
|
3010
|
+
/**
|
|
3011
|
+
* Get list of participants in the session (blocking version for FFI)
|
|
3012
|
+
*/ participantsList(): Array<Name>;
|
|
3013
|
+
/**
|
|
3014
|
+
* Get list of participants in the session
|
|
3015
|
+
*/ participantsListAsync(asyncOpts_?: {
|
|
3016
|
+
signal: AbortSignal;
|
|
3017
|
+
}): Promise<Array<Name>>;
|
|
3018
|
+
/**
|
|
3019
|
+
* Publish a message to the session's destination (blocking version)
|
|
3020
|
+
*
|
|
3021
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3022
|
+
*
|
|
3023
|
+
* # Arguments
|
|
3024
|
+
* * `data` - The message payload bytes
|
|
3025
|
+
* * `payload_type` - Optional content type identifier
|
|
3026
|
+
* * `metadata` - Optional key-value metadata pairs
|
|
3027
|
+
*
|
|
3028
|
+
* # Returns
|
|
3029
|
+
* * `Ok(CompletionHandle)` - Handle to await delivery confirmation
|
|
3030
|
+
* * `Err(SlimError)` - If publishing fails
|
|
3031
|
+
*
|
|
3032
|
+
* # Example
|
|
3033
|
+
* ```ignore
|
|
3034
|
+
* let completion = session.publish(data, None, None)?;
|
|
3035
|
+
* completion.wait()?; // Blocks until message is delivered
|
|
3036
|
+
* ```
|
|
3037
|
+
*/ publish(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
|
|
3038
|
+
/**
|
|
3039
|
+
* Publish a message and wait for completion (blocking version)
|
|
3040
|
+
*
|
|
3041
|
+
* This method publishes a message and blocks until the delivery completes.
|
|
3042
|
+
*/ publishAndWait(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
|
|
3043
|
+
/**
|
|
3044
|
+
* Publish a message and wait for completion (async version)
|
|
3045
|
+
*
|
|
3046
|
+
* This method publishes a message and waits until the delivery completes.
|
|
3047
|
+
*/ publishAndWaitAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3048
|
+
signal: AbortSignal;
|
|
3049
|
+
}): void;
|
|
3050
|
+
/**
|
|
3051
|
+
* Publish a message to the session's destination (async version)
|
|
3052
|
+
*
|
|
3053
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3054
|
+
*/ publishAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3055
|
+
signal: AbortSignal;
|
|
3056
|
+
}): Promise<CompletionHandle>;
|
|
3057
|
+
/**
|
|
3058
|
+
* Publish a reply message to the originator of a received message (blocking version for FFI)
|
|
3059
|
+
*
|
|
3060
|
+
* This method uses the routing information from a previously received message
|
|
3061
|
+
* to send a reply back to the sender. This is the preferred way to implement
|
|
3062
|
+
* request/reply patterns.
|
|
3063
|
+
*
|
|
3064
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3065
|
+
*
|
|
3066
|
+
* # Arguments
|
|
3067
|
+
* * `message_context` - Context from a message received via `get_message()`
|
|
3068
|
+
* * `data` - The reply payload bytes
|
|
3069
|
+
* * `payload_type` - Optional content type identifier
|
|
3070
|
+
* * `metadata` - Optional key-value metadata pairs
|
|
3071
|
+
*
|
|
3072
|
+
* # Returns
|
|
3073
|
+
* * `Ok(CompletionHandle)` - Handle to await delivery confirmation
|
|
3074
|
+
* * `Err(SlimError)` - If publishing fails
|
|
3075
|
+
*/ publishTo(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
|
|
3076
|
+
/**
|
|
3077
|
+
* Publish a reply message and wait for completion (blocking version)
|
|
3078
|
+
*
|
|
3079
|
+
* This method publishes a reply to a received message and blocks until the delivery completes.
|
|
3080
|
+
*/ publishToAndWait(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
|
|
3081
|
+
/**
|
|
3082
|
+
* Publish a reply message and wait for completion (async version)
|
|
3083
|
+
*
|
|
3084
|
+
* This method publishes a reply to a received message and waits until the delivery completes.
|
|
3085
|
+
*/ publishToAndWaitAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3086
|
+
signal: AbortSignal;
|
|
3087
|
+
}): void;
|
|
3088
|
+
/**
|
|
3089
|
+
* Publish a reply message (async version)
|
|
3090
|
+
*
|
|
3091
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3092
|
+
*/ publishToAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3093
|
+
signal: AbortSignal;
|
|
3094
|
+
}): Promise<CompletionHandle>;
|
|
3095
|
+
/**
|
|
3096
|
+
* Low-level publish with full control over all parameters (blocking version for FFI)
|
|
3097
|
+
*
|
|
3098
|
+
* This is an advanced method that provides complete control over routing and delivery.
|
|
3099
|
+
* Most users should use `publish()` or `publish_to()` instead.
|
|
3100
|
+
*
|
|
3101
|
+
* # Arguments
|
|
3102
|
+
* * `destination` - Target name to send to
|
|
3103
|
+
* * `fanout` - Number of copies to send (for multicast)
|
|
3104
|
+
* * `data` - The message payload bytes
|
|
3105
|
+
* * `connection_out` - Optional specific connection ID to use
|
|
3106
|
+
* * `payload_type` - Optional content type identifier
|
|
3107
|
+
* * `metadata` - Optional key-value metadata pairs
|
|
3108
|
+
*/ publishWithParams(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
|
|
3109
|
+
/**
|
|
3110
|
+
* Low-level publish with full control (async version)
|
|
3111
|
+
*/ publishWithParamsAsync(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3112
|
+
signal: AbortSignal;
|
|
3113
|
+
}): void;
|
|
3114
|
+
/**
|
|
3115
|
+
* Remove a participant from the session (blocking version)
|
|
3116
|
+
*
|
|
3117
|
+
* Returns a completion handle that can be awaited to ensure the removal completes.
|
|
3118
|
+
*/ remove(participant: Name): CompletionHandle;
|
|
3119
|
+
/**
|
|
3120
|
+
* Remove a participant and wait for completion (blocking version)
|
|
3121
|
+
*
|
|
3122
|
+
* This method removes a participant and blocks until the removal completes.
|
|
3123
|
+
*/ removeAndWait(participant: Name): void;
|
|
3124
|
+
/**
|
|
3125
|
+
* Remove a participant and wait for completion (async version)
|
|
3126
|
+
*
|
|
3127
|
+
* This method removes a participant and waits until the removal completes.
|
|
3128
|
+
*/ removeAndWaitAsync(participant: Name, asyncOpts_?: {
|
|
3129
|
+
signal: AbortSignal;
|
|
3130
|
+
}): void;
|
|
3131
|
+
/**
|
|
3132
|
+
* Remove a participant from the session (async version)
|
|
3133
|
+
*
|
|
3134
|
+
* Returns a completion handle that can be awaited to ensure the removal completes.
|
|
3135
|
+
*/ removeAsync(participant: Name, asyncOpts_?: {
|
|
3136
|
+
signal: AbortSignal;
|
|
3137
|
+
}): Promise<CompletionHandle>;
|
|
3138
|
+
/**
|
|
3139
|
+
* Get the session ID
|
|
3140
|
+
*/ sessionId(): number;
|
|
3141
|
+
/**
|
|
3142
|
+
* Get the session type (PointToPoint or Group)
|
|
3143
|
+
*/ sessionType(): SessionType;
|
|
3144
|
+
/**
|
|
3145
|
+
* Get the source name for this session
|
|
3146
|
+
*/ source(): Name;
|
|
3147
|
+
};
|
|
3148
|
+
/**
|
|
3149
|
+
* Session context for language bindings (UniFFI-compatible)
|
|
3150
|
+
*
|
|
3151
|
+
* Wraps the session context with proper async access patterns for message reception.
|
|
3152
|
+
* Provides both synchronous (blocking) and asynchronous methods for FFI compatibility.
|
|
3153
|
+
*/
|
|
3154
|
+
export declare class Session extends UniffiAbstractObject implements SessionInterface {
|
|
3155
|
+
readonly [uniffiTypeNameSymbol]: "Session";
|
|
3156
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
3157
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
3158
|
+
/**
|
|
3159
|
+
* Get the session configuration
|
|
3160
|
+
*/ config(): SessionConfig;
|
|
3161
|
+
/**
|
|
3162
|
+
* Get the destination name for this session
|
|
3163
|
+
*/ destination(): Name;
|
|
3164
|
+
/**
|
|
3165
|
+
* Receive a message from the session (blocking version for FFI)
|
|
3166
|
+
*
|
|
3167
|
+
* # Arguments
|
|
3168
|
+
* * `timeout` - Optional timeout duration
|
|
3169
|
+
*
|
|
3170
|
+
* # Returns
|
|
3171
|
+
* * `Ok(ReceivedMessage)` - Message with context and payload bytes
|
|
3172
|
+
* * `Err(SlimError)` - If the receive fails or times out
|
|
3173
|
+
*/ getMessage(timeout: number | undefined): ReceivedMessage;
|
|
3174
|
+
/**
|
|
3175
|
+
* Receive a message from the session (async version)
|
|
3176
|
+
*/ getMessageAsync(timeout: number | undefined, asyncOpts_?: {
|
|
3177
|
+
signal: AbortSignal;
|
|
3178
|
+
}): Promise<ReceivedMessage>;
|
|
3179
|
+
/**
|
|
3180
|
+
* Invite a participant to the session (blocking version)
|
|
3181
|
+
*
|
|
3182
|
+
* Returns a completion handle that can be awaited to ensure the invitation completes.
|
|
3183
|
+
*/ invite(participant: Name): CompletionHandle;
|
|
3184
|
+
/**
|
|
3185
|
+
* Invite a participant and wait for completion (blocking version)
|
|
3186
|
+
*
|
|
3187
|
+
* This method invites a participant and blocks until the invitation completes.
|
|
3188
|
+
*/ inviteAndWait(participant: Name): void;
|
|
3189
|
+
/**
|
|
3190
|
+
* Invite a participant and wait for completion (async version)
|
|
3191
|
+
*
|
|
3192
|
+
* This method invites a participant and waits until the invitation completes.
|
|
3193
|
+
*/ inviteAndWaitAsync(participant: Name, asyncOpts_?: {
|
|
3194
|
+
signal: AbortSignal;
|
|
3195
|
+
}): void;
|
|
3196
|
+
/**
|
|
3197
|
+
* Invite a participant to the session (async version)
|
|
3198
|
+
*
|
|
3199
|
+
* Returns a completion handle that can be awaited to ensure the invitation completes.
|
|
3200
|
+
*/ inviteAsync(participant: Name, asyncOpts_?: {
|
|
3201
|
+
signal: AbortSignal;
|
|
3202
|
+
}): Promise<CompletionHandle>;
|
|
3203
|
+
/**
|
|
3204
|
+
* Check if this session is the initiator
|
|
3205
|
+
*/ isInitiator(): boolean;
|
|
3206
|
+
/**
|
|
3207
|
+
* Get the session metadata
|
|
3208
|
+
*/ metadata(): Map<string, string>;
|
|
3209
|
+
/**
|
|
3210
|
+
* Get list of participants in the session (blocking version for FFI)
|
|
3211
|
+
*/ participantsList(): Array<Name>;
|
|
3212
|
+
/**
|
|
3213
|
+
* Get list of participants in the session
|
|
3214
|
+
*/ participantsListAsync(asyncOpts_?: {
|
|
3215
|
+
signal: AbortSignal;
|
|
3216
|
+
}): Promise<Array<Name>>;
|
|
3217
|
+
/**
|
|
3218
|
+
* Publish a message to the session's destination (blocking version)
|
|
3219
|
+
*
|
|
3220
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3221
|
+
*
|
|
3222
|
+
* # Arguments
|
|
3223
|
+
* * `data` - The message payload bytes
|
|
3224
|
+
* * `payload_type` - Optional content type identifier
|
|
3225
|
+
* * `metadata` - Optional key-value metadata pairs
|
|
3226
|
+
*
|
|
3227
|
+
* # Returns
|
|
3228
|
+
* * `Ok(CompletionHandle)` - Handle to await delivery confirmation
|
|
3229
|
+
* * `Err(SlimError)` - If publishing fails
|
|
3230
|
+
*
|
|
3231
|
+
* # Example
|
|
3232
|
+
* ```ignore
|
|
3233
|
+
* let completion = session.publish(data, None, None)?;
|
|
3234
|
+
* completion.wait()?; // Blocks until message is delivered
|
|
3235
|
+
* ```
|
|
3236
|
+
*/ publish(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
|
|
3237
|
+
/**
|
|
3238
|
+
* Publish a message and wait for completion (blocking version)
|
|
3239
|
+
*
|
|
3240
|
+
* This method publishes a message and blocks until the delivery completes.
|
|
3241
|
+
*/ publishAndWait(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
|
|
3242
|
+
/**
|
|
3243
|
+
* Publish a message and wait for completion (async version)
|
|
3244
|
+
*
|
|
3245
|
+
* This method publishes a message and waits until the delivery completes.
|
|
3246
|
+
*/ publishAndWaitAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3247
|
+
signal: AbortSignal;
|
|
3248
|
+
}): void;
|
|
3249
|
+
/**
|
|
3250
|
+
* Publish a message to the session's destination (async version)
|
|
3251
|
+
*
|
|
3252
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3253
|
+
*/ publishAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3254
|
+
signal: AbortSignal;
|
|
3255
|
+
}): Promise<CompletionHandle>;
|
|
3256
|
+
/**
|
|
3257
|
+
* Publish a reply message to the originator of a received message (blocking version for FFI)
|
|
3258
|
+
*
|
|
3259
|
+
* This method uses the routing information from a previously received message
|
|
3260
|
+
* to send a reply back to the sender. This is the preferred way to implement
|
|
3261
|
+
* request/reply patterns.
|
|
3262
|
+
*
|
|
3263
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3264
|
+
*
|
|
3265
|
+
* # Arguments
|
|
3266
|
+
* * `message_context` - Context from a message received via `get_message()`
|
|
3267
|
+
* * `data` - The reply payload bytes
|
|
3268
|
+
* * `payload_type` - Optional content type identifier
|
|
3269
|
+
* * `metadata` - Optional key-value metadata pairs
|
|
3270
|
+
*
|
|
3271
|
+
* # Returns
|
|
3272
|
+
* * `Ok(CompletionHandle)` - Handle to await delivery confirmation
|
|
3273
|
+
* * `Err(SlimError)` - If publishing fails
|
|
3274
|
+
*/ publishTo(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
|
|
3275
|
+
/**
|
|
3276
|
+
* Publish a reply message and wait for completion (blocking version)
|
|
3277
|
+
*
|
|
3278
|
+
* This method publishes a reply to a received message and blocks until the delivery completes.
|
|
3279
|
+
*/ publishToAndWait(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
|
|
3280
|
+
/**
|
|
3281
|
+
* Publish a reply message and wait for completion (async version)
|
|
3282
|
+
*
|
|
3283
|
+
* This method publishes a reply to a received message and waits until the delivery completes.
|
|
3284
|
+
*/ publishToAndWaitAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3285
|
+
signal: AbortSignal;
|
|
3286
|
+
}): void;
|
|
3287
|
+
/**
|
|
3288
|
+
* Publish a reply message (async version)
|
|
3289
|
+
*
|
|
3290
|
+
* Returns a completion handle that can be awaited to ensure the message was delivered.
|
|
3291
|
+
*/ publishToAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3292
|
+
signal: AbortSignal;
|
|
3293
|
+
}): Promise<CompletionHandle>;
|
|
3294
|
+
/**
|
|
3295
|
+
* Low-level publish with full control over all parameters (blocking version for FFI)
|
|
3296
|
+
*
|
|
3297
|
+
* This is an advanced method that provides complete control over routing and delivery.
|
|
3298
|
+
* Most users should use `publish()` or `publish_to()` instead.
|
|
3299
|
+
*
|
|
3300
|
+
* # Arguments
|
|
3301
|
+
* * `destination` - Target name to send to
|
|
3302
|
+
* * `fanout` - Number of copies to send (for multicast)
|
|
3303
|
+
* * `data` - The message payload bytes
|
|
3304
|
+
* * `connection_out` - Optional specific connection ID to use
|
|
3305
|
+
* * `payload_type` - Optional content type identifier
|
|
3306
|
+
* * `metadata` - Optional key-value metadata pairs
|
|
3307
|
+
*/ publishWithParams(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
|
|
3308
|
+
/**
|
|
3309
|
+
* Low-level publish with full control (async version)
|
|
3310
|
+
*/ publishWithParamsAsync(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
|
|
3311
|
+
signal: AbortSignal;
|
|
3312
|
+
}): void;
|
|
3313
|
+
/**
|
|
3314
|
+
* Remove a participant from the session (blocking version)
|
|
3315
|
+
*
|
|
3316
|
+
* Returns a completion handle that can be awaited to ensure the removal completes.
|
|
3317
|
+
*/ remove(participant: Name): CompletionHandle;
|
|
3318
|
+
/**
|
|
3319
|
+
* Remove a participant and wait for completion (blocking version)
|
|
3320
|
+
*
|
|
3321
|
+
* This method removes a participant and blocks until the removal completes.
|
|
3322
|
+
*/ removeAndWait(participant: Name): void;
|
|
3323
|
+
/**
|
|
3324
|
+
* Remove a participant and wait for completion (async version)
|
|
3325
|
+
*
|
|
3326
|
+
* This method removes a participant and waits until the removal completes.
|
|
3327
|
+
*/ removeAndWaitAsync(participant: Name, asyncOpts_?: {
|
|
3328
|
+
signal: AbortSignal;
|
|
3329
|
+
}): void;
|
|
3330
|
+
/**
|
|
3331
|
+
* Remove a participant from the session (async version)
|
|
3332
|
+
*
|
|
3333
|
+
* Returns a completion handle that can be awaited to ensure the removal completes.
|
|
3334
|
+
*/ removeAsync(participant: Name, asyncOpts_?: {
|
|
3335
|
+
signal: AbortSignal;
|
|
3336
|
+
}): Promise<CompletionHandle>;
|
|
3337
|
+
/**
|
|
3338
|
+
* Get the session ID
|
|
3339
|
+
*/ sessionId(): number;
|
|
3340
|
+
/**
|
|
3341
|
+
* Get the session type (PointToPoint or Group)
|
|
3342
|
+
*/ sessionType(): SessionType;
|
|
3343
|
+
/**
|
|
3344
|
+
* Get the source name for this session
|
|
3345
|
+
*/ source(): Name;
|
|
3346
|
+
/**
|
|
3347
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3348
|
+
*/
|
|
3349
|
+
uniffiDestroy(): void;
|
|
3350
|
+
[Symbol.dispose]: () => void;
|
|
3351
|
+
static instanceOf(obj: any): obj is Session;
|
|
3352
|
+
}
|
|
3353
|
+
export type StreamStreamHandlerInterface = {
|
|
3354
|
+
/**
|
|
3355
|
+
* Handle a stream-to-stream RPC call
|
|
3356
|
+
*
|
|
3357
|
+
* # Arguments
|
|
3358
|
+
* * `stream` - Request stream to pull messages from
|
|
3359
|
+
* * `context` - RPC context with metadata and session information
|
|
3360
|
+
* * `sink` - Response sink to send streaming responses
|
|
3361
|
+
*
|
|
3362
|
+
* # Returns
|
|
3363
|
+
* Ok(()) if handling succeeded, or an error
|
|
3364
|
+
*
|
|
3365
|
+
* # Note
|
|
3366
|
+
* You must call `sink.close()` or `sink.send_error()` when done.
|
|
3367
|
+
*/ handle(stream: RequestStream, context: Context, sink: ResponseSink, asyncOpts_?: {
|
|
3368
|
+
signal: AbortSignal;
|
|
3369
|
+
}): void;
|
|
3370
|
+
};
|
|
3371
|
+
/**
|
|
3372
|
+
* Stream-to-Stream RPC handler trait
|
|
3373
|
+
*
|
|
3374
|
+
* Implement this trait to handle stream-to-stream RPC calls.
|
|
3375
|
+
* The handler receives multiple requests via the stream and sends multiple responses via the sink.
|
|
3376
|
+
*/
|
|
3377
|
+
export declare class StreamStreamHandler extends UniffiAbstractObject implements StreamStreamHandlerInterface {
|
|
3378
|
+
readonly [uniffiTypeNameSymbol]: "StreamStreamHandler";
|
|
3379
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
3380
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
3381
|
+
/**
|
|
3382
|
+
* Handle a stream-to-stream RPC call
|
|
3383
|
+
*
|
|
3384
|
+
* # Arguments
|
|
3385
|
+
* * `stream` - Request stream to pull messages from
|
|
3386
|
+
* * `context` - RPC context with metadata and session information
|
|
3387
|
+
* * `sink` - Response sink to send streaming responses
|
|
3388
|
+
*
|
|
3389
|
+
* # Returns
|
|
3390
|
+
* Ok(()) if handling succeeded, or an error
|
|
3391
|
+
*
|
|
3392
|
+
* # Note
|
|
3393
|
+
* You must call `sink.close()` or `sink.send_error()` when done.
|
|
3394
|
+
*/ handle(stream: RequestStream, context: Context, sink: ResponseSink, asyncOpts_?: {
|
|
3395
|
+
signal: AbortSignal;
|
|
3396
|
+
}): void;
|
|
3397
|
+
/**
|
|
3398
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3399
|
+
*/
|
|
3400
|
+
uniffiDestroy(): void;
|
|
3401
|
+
[Symbol.dispose]: () => void;
|
|
3402
|
+
static instanceOf(obj: any): obj is StreamStreamHandler;
|
|
3403
|
+
}
|
|
3404
|
+
export type StreamUnaryHandlerInterface = {
|
|
3405
|
+
/**
|
|
3406
|
+
* Handle a stream-to-unary RPC call
|
|
3407
|
+
*
|
|
3408
|
+
* # Arguments
|
|
3409
|
+
* * `stream` - Request stream to pull messages from
|
|
3410
|
+
* * `context` - RPC context with metadata and session information
|
|
3411
|
+
*
|
|
3412
|
+
* # Returns
|
|
3413
|
+
* The response message bytes or an error
|
|
3414
|
+
*/ handle(stream: RequestStream, context: Context, asyncOpts_?: {
|
|
3415
|
+
signal: AbortSignal;
|
|
3416
|
+
}): Promise<ArrayBuffer>;
|
|
3417
|
+
};
|
|
3418
|
+
/**
|
|
3419
|
+
* Stream-to-Unary RPC handler trait
|
|
3420
|
+
*
|
|
3421
|
+
* Implement this trait to handle stream-to-unary RPC calls.
|
|
3422
|
+
* The handler receives multiple requests via the stream and returns a single response.
|
|
3423
|
+
*/
|
|
3424
|
+
export declare class StreamUnaryHandler extends UniffiAbstractObject implements StreamUnaryHandlerInterface {
|
|
3425
|
+
readonly [uniffiTypeNameSymbol]: "StreamUnaryHandler";
|
|
3426
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
3427
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
3428
|
+
/**
|
|
3429
|
+
* Handle a stream-to-unary RPC call
|
|
3430
|
+
*
|
|
3431
|
+
* # Arguments
|
|
3432
|
+
* * `stream` - Request stream to pull messages from
|
|
3433
|
+
* * `context` - RPC context with metadata and session information
|
|
3434
|
+
*
|
|
3435
|
+
* # Returns
|
|
3436
|
+
* The response message bytes or an error
|
|
3437
|
+
*/ handle(stream: RequestStream, context: Context, asyncOpts_?: {
|
|
3438
|
+
signal: AbortSignal;
|
|
3439
|
+
}): Promise<ArrayBuffer>;
|
|
3440
|
+
/**
|
|
3441
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3442
|
+
*/
|
|
3443
|
+
uniffiDestroy(): void;
|
|
3444
|
+
[Symbol.dispose]: () => void;
|
|
3445
|
+
static instanceOf(obj: any): obj is StreamUnaryHandler;
|
|
3446
|
+
}
|
|
3447
|
+
export type UnaryStreamHandlerInterface = {
|
|
3448
|
+
/**
|
|
3449
|
+
* Handle a unary-to-stream RPC call
|
|
3450
|
+
*
|
|
3451
|
+
* # Arguments
|
|
3452
|
+
* * `request` - The request message bytes
|
|
3453
|
+
* * `context` - RPC context with metadata and session information
|
|
3454
|
+
* * `sink` - Response sink to send streaming responses
|
|
3455
|
+
*
|
|
3456
|
+
* # Returns
|
|
3457
|
+
* Ok(()) if handling succeeded, or an error
|
|
3458
|
+
*
|
|
3459
|
+
* # Note
|
|
3460
|
+
* You must call `sink.close()` or `sink.send_error()` when done.
|
|
3461
|
+
*/ handle(request: ArrayBuffer, context: Context, sink: ResponseSink, asyncOpts_?: {
|
|
3462
|
+
signal: AbortSignal;
|
|
3463
|
+
}): void;
|
|
3464
|
+
};
|
|
3465
|
+
/**
|
|
3466
|
+
* Unary-to-Stream RPC handler trait
|
|
3467
|
+
*
|
|
3468
|
+
* Implement this trait to handle unary-to-stream RPC calls.
|
|
3469
|
+
* The handler receives a single request and sends multiple responses via the sink.
|
|
3470
|
+
*/
|
|
3471
|
+
export declare class UnaryStreamHandler extends UniffiAbstractObject implements UnaryStreamHandlerInterface {
|
|
3472
|
+
readonly [uniffiTypeNameSymbol]: "UnaryStreamHandler";
|
|
3473
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
3474
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
3475
|
+
/**
|
|
3476
|
+
* Handle a unary-to-stream RPC call
|
|
3477
|
+
*
|
|
3478
|
+
* # Arguments
|
|
3479
|
+
* * `request` - The request message bytes
|
|
3480
|
+
* * `context` - RPC context with metadata and session information
|
|
3481
|
+
* * `sink` - Response sink to send streaming responses
|
|
3482
|
+
*
|
|
3483
|
+
* # Returns
|
|
3484
|
+
* Ok(()) if handling succeeded, or an error
|
|
3485
|
+
*
|
|
3486
|
+
* # Note
|
|
3487
|
+
* You must call `sink.close()` or `sink.send_error()` when done.
|
|
3488
|
+
*/ handle(request: ArrayBuffer, context: Context, sink: ResponseSink, asyncOpts_?: {
|
|
3489
|
+
signal: AbortSignal;
|
|
3490
|
+
}): void;
|
|
3491
|
+
/**
|
|
3492
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3493
|
+
*/
|
|
3494
|
+
uniffiDestroy(): void;
|
|
3495
|
+
[Symbol.dispose]: () => void;
|
|
3496
|
+
static instanceOf(obj: any): obj is UnaryStreamHandler;
|
|
3497
|
+
}
|
|
3498
|
+
export type UnaryUnaryHandlerInterface = {
|
|
3499
|
+
/**
|
|
3500
|
+
* Handle a unary-to-unary RPC call
|
|
3501
|
+
*
|
|
3502
|
+
* # Arguments
|
|
3503
|
+
* * `request` - The request message bytes
|
|
3504
|
+
* * `context` - RPC context with metadata and session information
|
|
3505
|
+
*
|
|
3506
|
+
* # Returns
|
|
3507
|
+
* The response message bytes or an error
|
|
3508
|
+
*/ handle(request: ArrayBuffer, context: Context, asyncOpts_?: {
|
|
3509
|
+
signal: AbortSignal;
|
|
3510
|
+
}): Promise<ArrayBuffer>;
|
|
3511
|
+
};
|
|
3512
|
+
/**
|
|
3513
|
+
* Unary-to-Unary RPC handler trait
|
|
3514
|
+
*
|
|
3515
|
+
* Implement this trait to handle unary-to-unary RPC calls.
|
|
3516
|
+
* The handler receives a single request and returns a single response.
|
|
3517
|
+
*/
|
|
3518
|
+
export declare class UnaryUnaryHandler extends UniffiAbstractObject implements UnaryUnaryHandlerInterface {
|
|
3519
|
+
readonly [uniffiTypeNameSymbol]: "UnaryUnaryHandler";
|
|
3520
|
+
readonly [destructorGuardSymbol]: UniffiRustArcPtr;
|
|
3521
|
+
readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
|
|
3522
|
+
/**
|
|
3523
|
+
* Handle a unary-to-unary RPC call
|
|
3524
|
+
*
|
|
3525
|
+
* # Arguments
|
|
3526
|
+
* * `request` - The request message bytes
|
|
3527
|
+
* * `context` - RPC context with metadata and session information
|
|
3528
|
+
*
|
|
3529
|
+
* # Returns
|
|
3530
|
+
* The response message bytes or an error
|
|
3531
|
+
*/ handle(request: ArrayBuffer, context: Context, asyncOpts_?: {
|
|
3532
|
+
signal: AbortSignal;
|
|
3533
|
+
}): Promise<ArrayBuffer>;
|
|
3534
|
+
/**
|
|
3535
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3536
|
+
*/
|
|
3537
|
+
uniffiDestroy(): void;
|
|
3538
|
+
[Symbol.dispose]: () => void;
|
|
3539
|
+
static instanceOf(obj: any): obj is UnaryUnaryHandler;
|
|
3540
|
+
}
|
|
3541
|
+
/**
|
|
3542
|
+
* Create a new Service with builder pattern
|
|
3543
|
+
*/
|
|
3544
|
+
export declare function createService(name: string): Service;
|
|
3545
|
+
/**
|
|
3546
|
+
* Create a new Service with configuration
|
|
3547
|
+
*/
|
|
3548
|
+
export declare function createServiceWithConfig(name: string, config: ServiceConfig): Service;
|
|
3549
|
+
/**
|
|
3550
|
+
* Get detailed build information
|
|
3551
|
+
*/
|
|
3552
|
+
export declare function getBuildInfo(): BuildInfo;
|
|
3553
|
+
/**
|
|
3554
|
+
* Get the global service instance (creates it if it doesn't exist)
|
|
3555
|
+
*
|
|
3556
|
+
* This returns a reference to the shared global service that can be used
|
|
3557
|
+
* across the application. All calls to this function return the same service instance.
|
|
3558
|
+
*/
|
|
3559
|
+
export declare function getGlobalService(): Service;
|
|
3560
|
+
/**
|
|
3561
|
+
* Returns references to all global services.
|
|
3562
|
+
* If not initialized, initializes with defaults first.
|
|
3563
|
+
*/
|
|
3564
|
+
export declare function getServices(): Array<Service>;
|
|
3565
|
+
/**
|
|
3566
|
+
* Get the version of the SLIM bindings (simple string)
|
|
3567
|
+
*/
|
|
3568
|
+
export declare function getVersion(): string;
|
|
3569
|
+
/**
|
|
3570
|
+
* Initialize SLIM bindings from a configuration file
|
|
3571
|
+
*
|
|
3572
|
+
* This function:
|
|
3573
|
+
* 1. Loads the configuration file
|
|
3574
|
+
* 2. Initializes the crypto provider
|
|
3575
|
+
* 3. Sets up tracing/logging exactly as the main SLIM application does
|
|
3576
|
+
* 4. Initializes the global runtime with configuration from the file
|
|
3577
|
+
* 5. Initializes and starts the global service with servers/clients from config
|
|
3578
|
+
*
|
|
3579
|
+
* This must be called before using any SLIM bindings functionality.
|
|
3580
|
+
* It's safe to call multiple times - subsequent calls will be ignored.
|
|
3581
|
+
*
|
|
3582
|
+
* # Arguments
|
|
3583
|
+
* * `config_path` - Path to the YAML configuration file
|
|
3584
|
+
*
|
|
3585
|
+
* # Returns
|
|
3586
|
+
* * `Ok(())` - Successfully initialized
|
|
3587
|
+
* * `Err(SlimError)` - If initialization fails
|
|
3588
|
+
*
|
|
3589
|
+
* # Example
|
|
3590
|
+
* ```ignore
|
|
3591
|
+
* initialize_from_config("/path/to/config.yaml")?;
|
|
3592
|
+
* ```
|
|
3593
|
+
*/
|
|
3594
|
+
export declare function initializeFromConfig(configPath: string): void;
|
|
3595
|
+
/**
|
|
3596
|
+
* Initialize SLIM bindings with custom configuration structs
|
|
3597
|
+
*
|
|
3598
|
+
* This function allows you to programmatically configure SLIM bindings by passing
|
|
3599
|
+
* configuration structs directly, without needing a config file.
|
|
3600
|
+
*
|
|
3601
|
+
* # Arguments
|
|
3602
|
+
* * `runtime_config` - Runtime configuration (thread count, naming, etc.)
|
|
3603
|
+
* * `tracing_config` - Tracing/logging configuration
|
|
3604
|
+
* * `service_config` - Service configuration (node ID, group name, etc.)
|
|
3605
|
+
*
|
|
3606
|
+
* # Returns
|
|
3607
|
+
* * `Ok(())` - Successfully initialized
|
|
3608
|
+
* * `Err(SlimError)` - If initialization fails
|
|
3609
|
+
*
|
|
3610
|
+
* # Example
|
|
3611
|
+
* ```ignore
|
|
3612
|
+
* let runtime_config = new_runtime_config();
|
|
3613
|
+
* let tracing_config = new_tracing_config();
|
|
3614
|
+
* let mut service_config = new_service_config();
|
|
3615
|
+
* service_config.node_id = Some("my-node".to_string());
|
|
3616
|
+
*
|
|
3617
|
+
* initialize_with_configs(runtime_config, tracing_config, service_config)?;
|
|
3618
|
+
* ```
|
|
3619
|
+
*/
|
|
3620
|
+
export declare function initializeWithConfigs(runtimeConfig: RuntimeConfig, tracingConfig: TracingConfig, serviceConfig: Array<ServiceConfig>): void;
|
|
3621
|
+
/**
|
|
3622
|
+
* Initialize SLIM bindings with default configuration
|
|
3623
|
+
*
|
|
3624
|
+
* This is a convenience function that initializes the bindings with:
|
|
3625
|
+
* - Default runtime configuration
|
|
3626
|
+
* - Default tracing/logging configuration
|
|
3627
|
+
* - Initialized crypto provider
|
|
3628
|
+
* - Default global service (no servers/clients)
|
|
3629
|
+
*
|
|
3630
|
+
* Use `initialize_from_config` for file-based configuration or
|
|
3631
|
+
* `initialize_with_configs` for programmatic configuration.
|
|
3632
|
+
*/
|
|
3633
|
+
export declare function initializeWithDefaults(): void;
|
|
3634
|
+
/**
|
|
3635
|
+
* Check if SLIM bindings have been initialized
|
|
3636
|
+
*/
|
|
3637
|
+
export declare function isInitialized(): boolean;
|
|
3638
|
+
/**
|
|
3639
|
+
* Create a new DataplaneConfig
|
|
3640
|
+
*/
|
|
3641
|
+
export declare function newDataplaneConfig(): DataplaneConfig;
|
|
3642
|
+
/**
|
|
3643
|
+
* Create a new insecure client config (no TLS)
|
|
3644
|
+
*/
|
|
3645
|
+
export declare function newInsecureClientConfig(endpoint: string): ClientConfig;
|
|
3646
|
+
/**
|
|
3647
|
+
* Create a new insecure server config (no TLS)
|
|
3648
|
+
*/
|
|
3649
|
+
export declare function newInsecureServerConfig(endpoint: string): ServerConfig;
|
|
3650
|
+
/**
|
|
3651
|
+
* Create a new BindingsRuntimeConfig with default values
|
|
3652
|
+
*/
|
|
3653
|
+
export declare function newRuntimeConfig(): RuntimeConfig;
|
|
3654
|
+
/**
|
|
3655
|
+
* Create a new BindingsRuntimeConfig with custom values
|
|
3656
|
+
*/
|
|
3657
|
+
export declare function newRuntimeConfigWith(nCores: bigint, threadName: string, drainTimeout: number): RuntimeConfig;
|
|
3658
|
+
/**
|
|
3659
|
+
* Create a new server config with the given endpoint and default values
|
|
3660
|
+
*/
|
|
3661
|
+
export declare function newServerConfig(endpoint: string): ServerConfig;
|
|
3662
|
+
/**
|
|
3663
|
+
* Create a new BindingsServiceConfig with default values
|
|
3664
|
+
*/
|
|
3665
|
+
export declare function newServiceConfig(): ServiceConfig;
|
|
3666
|
+
/**
|
|
3667
|
+
* Create a new BindingsServiceConfig with custom values
|
|
3668
|
+
*/
|
|
3669
|
+
export declare function newServiceConfigWith(nodeId: string | undefined, groupName: string | undefined, dataplane: DataplaneConfig): ServiceConfig;
|
|
3670
|
+
/**
|
|
3671
|
+
* Create a new ServiceConfiguration
|
|
3672
|
+
*/
|
|
3673
|
+
export declare function newServiceConfiguration(): ServiceConfig;
|
|
3674
|
+
/**
|
|
3675
|
+
* Create a new BindingsTracingConfig with default values
|
|
3676
|
+
*/
|
|
3677
|
+
export declare function newTracingConfig(): TracingConfig;
|
|
3678
|
+
/**
|
|
3679
|
+
* Create a new BindingsTracingConfig with custom values
|
|
3680
|
+
*/
|
|
3681
|
+
export declare function newTracingConfigWith(logLevel: string, displayThreadNames: boolean, displayThreadIds: boolean, filters: Array<string>): TracingConfig;
|
|
3682
|
+
/**
|
|
3683
|
+
* Perform graceful shutdown operations (blocking version)
|
|
3684
|
+
*
|
|
3685
|
+
* This is a blocking wrapper around the async `shutdown()` function for use from
|
|
3686
|
+
* synchronous contexts or language bindings that don't support async.
|
|
3687
|
+
*
|
|
3688
|
+
* # Returns
|
|
3689
|
+
* * `Ok(())` - Successfully shut down
|
|
3690
|
+
* * `Err(SlimError)` - If shutdown fails
|
|
3691
|
+
*/
|
|
3692
|
+
export declare function shutdownBlocking(): void;
|