tangled
alpha
login
or
join now
stream.place
/
streamplace
75
fork
atom
Live video on the AT Protocol
75
fork
atom
overview
issues
1
pulls
pipelines
iroh: weird linker fix for go test
Eli Mallon
7 months ago
679d9622
defcfe19
+8
-2967
4 changed files
expand all
collapse all
unified
split
pkg
iroh
generated
iroh_streamplace
deps.go
iroh_streamplace.go
rust
iroh-streamplace
pkg
iroh_streamplace
generated
iroh_streamplace
iroh_streamplace.go
iroh_streamplace.h
+7
pkg/iroh/generated/iroh_streamplace/deps.go
···
1
1
+
package iroh_streamplace
2
2
+
3
3
+
// This file exists because Go tests seem to be linking the tests in the wrong order
4
4
+
// doing it like this makes sure -lm is linked before the Rust code that needs it
5
5
+
6
6
+
// #cgo LDFLAGS: -lm
7
7
+
import "C"
+1
-1
pkg/iroh/iroh_streamplace.go
···
4
4
_ "stream.place/streamplace/pkg/iroh/generated/iroh_streamplace"
5
5
)
6
6
7
7
-
// #cgo LDFLAGS: -lm
8
7
// #cgo pkg-config: streamplacedeps-uninstalled
8
8
+
// #cgo LDFLAGS: -lm
9
9
// #cgo darwin LDFLAGS: -framework Security -framework SystemConfiguration
10
10
import "C"
-1992
rust/iroh-streamplace/pkg/iroh_streamplace/generated/iroh_streamplace/iroh_streamplace.go
···
1
1
-
package iroh_streamplace
2
2
-
3
3
-
// #include <iroh_streamplace.h>
4
4
-
import "C"
5
5
-
6
6
-
import (
7
7
-
"bytes"
8
8
-
"encoding/binary"
9
9
-
"fmt"
10
10
-
"io"
11
11
-
"math"
12
12
-
"runtime"
13
13
-
"runtime/cgo"
14
14
-
"sync"
15
15
-
"sync/atomic"
16
16
-
"unsafe"
17
17
-
)
18
18
-
19
19
-
// This is needed, because as of go 1.24
20
20
-
// type RustBuffer C.RustBuffer cannot have methods,
21
21
-
// RustBuffer is treated as non-local type
22
22
-
type GoRustBuffer struct {
23
23
-
inner C.RustBuffer
24
24
-
}
25
25
-
26
26
-
type RustBufferI interface {
27
27
-
AsReader() *bytes.Reader
28
28
-
Free()
29
29
-
ToGoBytes() []byte
30
30
-
Data() unsafe.Pointer
31
31
-
Len() uint64
32
32
-
Capacity() uint64
33
33
-
}
34
34
-
35
35
-
func RustBufferFromExternal(b RustBufferI) GoRustBuffer {
36
36
-
return GoRustBuffer{
37
37
-
inner: C.RustBuffer{
38
38
-
capacity: C.uint64_t(b.Capacity()),
39
39
-
len: C.uint64_t(b.Len()),
40
40
-
data: (*C.uchar)(b.Data()),
41
41
-
},
42
42
-
}
43
43
-
}
44
44
-
45
45
-
func (cb GoRustBuffer) Capacity() uint64 {
46
46
-
return uint64(cb.inner.capacity)
47
47
-
}
48
48
-
49
49
-
func (cb GoRustBuffer) Len() uint64 {
50
50
-
return uint64(cb.inner.len)
51
51
-
}
52
52
-
53
53
-
func (cb GoRustBuffer) Data() unsafe.Pointer {
54
54
-
return unsafe.Pointer(cb.inner.data)
55
55
-
}
56
56
-
57
57
-
func (cb GoRustBuffer) AsReader() *bytes.Reader {
58
58
-
b := unsafe.Slice((*byte)(cb.inner.data), C.uint64_t(cb.inner.len))
59
59
-
return bytes.NewReader(b)
60
60
-
}
61
61
-
62
62
-
func (cb GoRustBuffer) Free() {
63
63
-
rustCall(func(status *C.RustCallStatus) bool {
64
64
-
C.ffi_iroh_streamplace_rustbuffer_free(cb.inner, status)
65
65
-
return false
66
66
-
})
67
67
-
}
68
68
-
69
69
-
func (cb GoRustBuffer) ToGoBytes() []byte {
70
70
-
return C.GoBytes(unsafe.Pointer(cb.inner.data), C.int(cb.inner.len))
71
71
-
}
72
72
-
73
73
-
func stringToRustBuffer(str string) C.RustBuffer {
74
74
-
return bytesToRustBuffer([]byte(str))
75
75
-
}
76
76
-
77
77
-
func bytesToRustBuffer(b []byte) C.RustBuffer {
78
78
-
if len(b) == 0 {
79
79
-
return C.RustBuffer{}
80
80
-
}
81
81
-
// We can pass the pointer along here, as it is pinned
82
82
-
// for the duration of this call
83
83
-
foreign := C.ForeignBytes{
84
84
-
len: C.int(len(b)),
85
85
-
data: (*C.uchar)(unsafe.Pointer(&b[0])),
86
86
-
}
87
87
-
88
88
-
return rustCall(func(status *C.RustCallStatus) C.RustBuffer {
89
89
-
return C.ffi_iroh_streamplace_rustbuffer_from_bytes(foreign, status)
90
90
-
})
91
91
-
}
92
92
-
93
93
-
type BufLifter[GoType any] interface {
94
94
-
Lift(value RustBufferI) GoType
95
95
-
}
96
96
-
97
97
-
type BufLowerer[GoType any] interface {
98
98
-
Lower(value GoType) C.RustBuffer
99
99
-
}
100
100
-
101
101
-
type BufReader[GoType any] interface {
102
102
-
Read(reader io.Reader) GoType
103
103
-
}
104
104
-
105
105
-
type BufWriter[GoType any] interface {
106
106
-
Write(writer io.Writer, value GoType)
107
107
-
}
108
108
-
109
109
-
func LowerIntoRustBuffer[GoType any](bufWriter BufWriter[GoType], value GoType) C.RustBuffer {
110
110
-
// This might be not the most efficient way but it does not require knowing allocation size
111
111
-
// beforehand
112
112
-
var buffer bytes.Buffer
113
113
-
bufWriter.Write(&buffer, value)
114
114
-
115
115
-
bytes, err := io.ReadAll(&buffer)
116
116
-
if err != nil {
117
117
-
panic(fmt.Errorf("reading written data: %w", err))
118
118
-
}
119
119
-
return bytesToRustBuffer(bytes)
120
120
-
}
121
121
-
122
122
-
func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType {
123
123
-
defer rbuf.Free()
124
124
-
reader := rbuf.AsReader()
125
125
-
item := bufReader.Read(reader)
126
126
-
if reader.Len() > 0 {
127
127
-
// TODO: Remove this
128
128
-
leftover, _ := io.ReadAll(reader)
129
129
-
panic(fmt.Errorf("Junk remaining in buffer after lifting: %s", string(leftover)))
130
130
-
}
131
131
-
return item
132
132
-
}
133
133
-
134
134
-
func rustCallWithError[E any, U any](converter BufReader[*E], callback func(*C.RustCallStatus) U) (U, *E) {
135
135
-
var status C.RustCallStatus
136
136
-
returnValue := callback(&status)
137
137
-
err := checkCallStatus(converter, status)
138
138
-
return returnValue, err
139
139
-
}
140
140
-
141
141
-
func checkCallStatus[E any](converter BufReader[*E], status C.RustCallStatus) *E {
142
142
-
switch status.code {
143
143
-
case 0:
144
144
-
return nil
145
145
-
case 1:
146
146
-
return LiftFromRustBuffer(converter, GoRustBuffer{inner: status.errorBuf})
147
147
-
case 2:
148
148
-
// when the rust code sees a panic, it tries to construct a rustBuffer
149
149
-
// with the message. but if that code panics, then it just sends back
150
150
-
// an empty buffer.
151
151
-
if status.errorBuf.len > 0 {
152
152
-
panic(fmt.Errorf("%s", FfiConverterStringINSTANCE.Lift(GoRustBuffer{inner: status.errorBuf})))
153
153
-
} else {
154
154
-
panic(fmt.Errorf("Rust panicked while handling Rust panic"))
155
155
-
}
156
156
-
default:
157
157
-
panic(fmt.Errorf("unknown status code: %d", status.code))
158
158
-
}
159
159
-
}
160
160
-
161
161
-
func checkCallStatusUnknown(status C.RustCallStatus) error {
162
162
-
switch status.code {
163
163
-
case 0:
164
164
-
return nil
165
165
-
case 1:
166
166
-
panic(fmt.Errorf("function not returning an error returned an error"))
167
167
-
case 2:
168
168
-
// when the rust code sees a panic, it tries to construct a C.RustBuffer
169
169
-
// with the message. but if that code panics, then it just sends back
170
170
-
// an empty buffer.
171
171
-
if status.errorBuf.len > 0 {
172
172
-
panic(fmt.Errorf("%s", FfiConverterStringINSTANCE.Lift(GoRustBuffer{
173
173
-
inner: status.errorBuf,
174
174
-
})))
175
175
-
} else {
176
176
-
panic(fmt.Errorf("Rust panicked while handling Rust panic"))
177
177
-
}
178
178
-
default:
179
179
-
return fmt.Errorf("unknown status code: %d", status.code)
180
180
-
}
181
181
-
}
182
182
-
183
183
-
func rustCall[U any](callback func(*C.RustCallStatus) U) U {
184
184
-
returnValue, err := rustCallWithError[error](nil, callback)
185
185
-
if err != nil {
186
186
-
panic(err)
187
187
-
}
188
188
-
return returnValue
189
189
-
}
190
190
-
191
191
-
type NativeError interface {
192
192
-
AsError() error
193
193
-
}
194
194
-
195
195
-
func writeInt8(writer io.Writer, value int8) {
196
196
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
197
197
-
panic(err)
198
198
-
}
199
199
-
}
200
200
-
201
201
-
func writeUint8(writer io.Writer, value uint8) {
202
202
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
203
203
-
panic(err)
204
204
-
}
205
205
-
}
206
206
-
207
207
-
func writeInt16(writer io.Writer, value int16) {
208
208
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
209
209
-
panic(err)
210
210
-
}
211
211
-
}
212
212
-
213
213
-
func writeUint16(writer io.Writer, value uint16) {
214
214
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
215
215
-
panic(err)
216
216
-
}
217
217
-
}
218
218
-
219
219
-
func writeInt32(writer io.Writer, value int32) {
220
220
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
221
221
-
panic(err)
222
222
-
}
223
223
-
}
224
224
-
225
225
-
func writeUint32(writer io.Writer, value uint32) {
226
226
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
227
227
-
panic(err)
228
228
-
}
229
229
-
}
230
230
-
231
231
-
func writeInt64(writer io.Writer, value int64) {
232
232
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
233
233
-
panic(err)
234
234
-
}
235
235
-
}
236
236
-
237
237
-
func writeUint64(writer io.Writer, value uint64) {
238
238
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
239
239
-
panic(err)
240
240
-
}
241
241
-
}
242
242
-
243
243
-
func writeFloat32(writer io.Writer, value float32) {
244
244
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
245
245
-
panic(err)
246
246
-
}
247
247
-
}
248
248
-
249
249
-
func writeFloat64(writer io.Writer, value float64) {
250
250
-
if err := binary.Write(writer, binary.BigEndian, value); err != nil {
251
251
-
panic(err)
252
252
-
}
253
253
-
}
254
254
-
255
255
-
func readInt8(reader io.Reader) int8 {
256
256
-
var result int8
257
257
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
258
258
-
panic(err)
259
259
-
}
260
260
-
return result
261
261
-
}
262
262
-
263
263
-
func readUint8(reader io.Reader) uint8 {
264
264
-
var result uint8
265
265
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
266
266
-
panic(err)
267
267
-
}
268
268
-
return result
269
269
-
}
270
270
-
271
271
-
func readInt16(reader io.Reader) int16 {
272
272
-
var result int16
273
273
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
274
274
-
panic(err)
275
275
-
}
276
276
-
return result
277
277
-
}
278
278
-
279
279
-
func readUint16(reader io.Reader) uint16 {
280
280
-
var result uint16
281
281
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
282
282
-
panic(err)
283
283
-
}
284
284
-
return result
285
285
-
}
286
286
-
287
287
-
func readInt32(reader io.Reader) int32 {
288
288
-
var result int32
289
289
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
290
290
-
panic(err)
291
291
-
}
292
292
-
return result
293
293
-
}
294
294
-
295
295
-
func readUint32(reader io.Reader) uint32 {
296
296
-
var result uint32
297
297
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
298
298
-
panic(err)
299
299
-
}
300
300
-
return result
301
301
-
}
302
302
-
303
303
-
func readInt64(reader io.Reader) int64 {
304
304
-
var result int64
305
305
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
306
306
-
panic(err)
307
307
-
}
308
308
-
return result
309
309
-
}
310
310
-
311
311
-
func readUint64(reader io.Reader) uint64 {
312
312
-
var result uint64
313
313
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
314
314
-
panic(err)
315
315
-
}
316
316
-
return result
317
317
-
}
318
318
-
319
319
-
func readFloat32(reader io.Reader) float32 {
320
320
-
var result float32
321
321
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
322
322
-
panic(err)
323
323
-
}
324
324
-
return result
325
325
-
}
326
326
-
327
327
-
func readFloat64(reader io.Reader) float64 {
328
328
-
var result float64
329
329
-
if err := binary.Read(reader, binary.BigEndian, &result); err != nil {
330
330
-
panic(err)
331
331
-
}
332
332
-
return result
333
333
-
}
334
334
-
335
335
-
func init() {
336
336
-
337
337
-
FfiConverterDataHandlerINSTANCE.register()
338
338
-
uniffiCheckChecksums()
339
339
-
}
340
340
-
341
341
-
func uniffiCheckChecksums() {
342
342
-
// Get the bindings contract version from our ComponentInterface
343
343
-
bindingsContractVersion := 26
344
344
-
// Get the scaffolding contract version by calling the into the dylib
345
345
-
scaffoldingContractVersion := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint32_t {
346
346
-
return C.ffi_iroh_streamplace_uniffi_contract_version()
347
347
-
})
348
348
-
if bindingsContractVersion != int(scaffoldingContractVersion) {
349
349
-
// If this happens try cleaning and rebuilding your project
350
350
-
panic("iroh_streamplace: UniFFI contract version mismatch")
351
351
-
}
352
352
-
{
353
353
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
354
354
-
return C.uniffi_iroh_streamplace_checksum_method_datahandler_handle_data()
355
355
-
})
356
356
-
if checksum != 61779 {
357
357
-
// If this happens try cleaning and rebuilding your project
358
358
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_datahandler_handle_data: UniFFI API checksum mismatch")
359
359
-
}
360
360
-
}
361
361
-
{
362
362
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
363
363
-
return C.uniffi_iroh_streamplace_checksum_method_endpoint_node_addr()
364
364
-
})
365
365
-
if checksum != 17254 {
366
366
-
// If this happens try cleaning and rebuilding your project
367
367
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_endpoint_node_addr: UniFFI API checksum mismatch")
368
368
-
}
369
369
-
}
370
370
-
{
371
371
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
372
372
-
return C.uniffi_iroh_streamplace_checksum_method_nodeaddr_direct_addresses()
373
373
-
})
374
374
-
if checksum != 17536 {
375
375
-
// If this happens try cleaning and rebuilding your project
376
376
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_nodeaddr_direct_addresses: UniFFI API checksum mismatch")
377
377
-
}
378
378
-
}
379
379
-
{
380
380
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
381
381
-
return C.uniffi_iroh_streamplace_checksum_method_nodeaddr_equal()
382
382
-
})
383
383
-
if checksum != 15520 {
384
384
-
// If this happens try cleaning and rebuilding your project
385
385
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_nodeaddr_equal: UniFFI API checksum mismatch")
386
386
-
}
387
387
-
}
388
388
-
{
389
389
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
390
390
-
return C.uniffi_iroh_streamplace_checksum_method_nodeaddr_node_id()
391
391
-
})
392
392
-
if checksum != 35476 {
393
393
-
// If this happens try cleaning and rebuilding your project
394
394
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_nodeaddr_node_id: UniFFI API checksum mismatch")
395
395
-
}
396
396
-
}
397
397
-
{
398
398
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
399
399
-
return C.uniffi_iroh_streamplace_checksum_method_nodeaddr_relay_url()
400
400
-
})
401
401
-
if checksum != 18967 {
402
402
-
// If this happens try cleaning and rebuilding your project
403
403
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_nodeaddr_relay_url: UniFFI API checksum mismatch")
404
404
-
}
405
405
-
}
406
406
-
{
407
407
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
408
408
-
return C.uniffi_iroh_streamplace_checksum_method_publickey_equal()
409
409
-
})
410
410
-
if checksum != 25030 {
411
411
-
// If this happens try cleaning and rebuilding your project
412
412
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_publickey_equal: UniFFI API checksum mismatch")
413
413
-
}
414
414
-
}
415
415
-
{
416
416
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
417
417
-
return C.uniffi_iroh_streamplace_checksum_method_publickey_fmt_short()
418
418
-
})
419
419
-
if checksum != 57639 {
420
420
-
// If this happens try cleaning and rebuilding your project
421
421
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_publickey_fmt_short: UniFFI API checksum mismatch")
422
422
-
}
423
423
-
}
424
424
-
{
425
425
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
426
426
-
return C.uniffi_iroh_streamplace_checksum_method_publickey_to_bytes()
427
427
-
})
428
428
-
if checksum != 8223 {
429
429
-
// If this happens try cleaning and rebuilding your project
430
430
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_publickey_to_bytes: UniFFI API checksum mismatch")
431
431
-
}
432
432
-
}
433
433
-
{
434
434
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
435
435
-
return C.uniffi_iroh_streamplace_checksum_method_receiver_node_addr()
436
436
-
})
437
437
-
if checksum != 10730 {
438
438
-
// If this happens try cleaning and rebuilding your project
439
439
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_receiver_node_addr: UniFFI API checksum mismatch")
440
440
-
}
441
441
-
}
442
442
-
{
443
443
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
444
444
-
return C.uniffi_iroh_streamplace_checksum_method_sender_add_peer()
445
445
-
})
446
446
-
if checksum != 34321 {
447
447
-
// If this happens try cleaning and rebuilding your project
448
448
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_sender_add_peer: UniFFI API checksum mismatch")
449
449
-
}
450
450
-
}
451
451
-
{
452
452
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
453
453
-
return C.uniffi_iroh_streamplace_checksum_method_sender_node_addr()
454
454
-
})
455
455
-
if checksum != 38541 {
456
456
-
// If this happens try cleaning and rebuilding your project
457
457
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_sender_node_addr: UniFFI API checksum mismatch")
458
458
-
}
459
459
-
}
460
460
-
{
461
461
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
462
462
-
return C.uniffi_iroh_streamplace_checksum_method_sender_send()
463
463
-
})
464
464
-
if checksum != 24369 {
465
465
-
// If this happens try cleaning and rebuilding your project
466
466
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_method_sender_send: UniFFI API checksum mismatch")
467
467
-
}
468
468
-
}
469
469
-
{
470
470
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
471
471
-
return C.uniffi_iroh_streamplace_checksum_constructor_endpoint_new()
472
472
-
})
473
473
-
if checksum != 60672 {
474
474
-
// If this happens try cleaning and rebuilding your project
475
475
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_constructor_endpoint_new: UniFFI API checksum mismatch")
476
476
-
}
477
477
-
}
478
478
-
{
479
479
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
480
480
-
return C.uniffi_iroh_streamplace_checksum_constructor_nodeaddr_new()
481
481
-
})
482
482
-
if checksum != 28044 {
483
483
-
// If this happens try cleaning and rebuilding your project
484
484
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_constructor_nodeaddr_new: UniFFI API checksum mismatch")
485
485
-
}
486
486
-
}
487
487
-
{
488
488
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
489
489
-
return C.uniffi_iroh_streamplace_checksum_constructor_publickey_from_bytes()
490
490
-
})
491
491
-
if checksum != 54187 {
492
492
-
// If this happens try cleaning and rebuilding your project
493
493
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_constructor_publickey_from_bytes: UniFFI API checksum mismatch")
494
494
-
}
495
495
-
}
496
496
-
{
497
497
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
498
498
-
return C.uniffi_iroh_streamplace_checksum_constructor_publickey_from_string()
499
499
-
})
500
500
-
if checksum != 62773 {
501
501
-
// If this happens try cleaning and rebuilding your project
502
502
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_constructor_publickey_from_string: UniFFI API checksum mismatch")
503
503
-
}
504
504
-
}
505
505
-
{
506
506
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
507
507
-
return C.uniffi_iroh_streamplace_checksum_constructor_receiver_new()
508
508
-
})
509
509
-
if checksum != 35153 {
510
510
-
// If this happens try cleaning and rebuilding your project
511
511
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_constructor_receiver_new: UniFFI API checksum mismatch")
512
512
-
}
513
513
-
}
514
514
-
{
515
515
-
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
516
516
-
return C.uniffi_iroh_streamplace_checksum_constructor_sender_new()
517
517
-
})
518
518
-
if checksum != 27594 {
519
519
-
// If this happens try cleaning and rebuilding your project
520
520
-
panic("iroh_streamplace: uniffi_iroh_streamplace_checksum_constructor_sender_new: UniFFI API checksum mismatch")
521
521
-
}
522
522
-
}
523
523
-
}
524
524
-
525
525
-
type FfiConverterBool struct{}
526
526
-
527
527
-
var FfiConverterBoolINSTANCE = FfiConverterBool{}
528
528
-
529
529
-
func (FfiConverterBool) Lower(value bool) C.int8_t {
530
530
-
if value {
531
531
-
return C.int8_t(1)
532
532
-
}
533
533
-
return C.int8_t(0)
534
534
-
}
535
535
-
536
536
-
func (FfiConverterBool) Write(writer io.Writer, value bool) {
537
537
-
if value {
538
538
-
writeInt8(writer, 1)
539
539
-
} else {
540
540
-
writeInt8(writer, 0)
541
541
-
}
542
542
-
}
543
543
-
544
544
-
func (FfiConverterBool) Lift(value C.int8_t) bool {
545
545
-
return value != 0
546
546
-
}
547
547
-
548
548
-
func (FfiConverterBool) Read(reader io.Reader) bool {
549
549
-
return readInt8(reader) != 0
550
550
-
}
551
551
-
552
552
-
type FfiDestroyerBool struct{}
553
553
-
554
554
-
func (FfiDestroyerBool) Destroy(_ bool) {}
555
555
-
556
556
-
type FfiConverterString struct{}
557
557
-
558
558
-
var FfiConverterStringINSTANCE = FfiConverterString{}
559
559
-
560
560
-
func (FfiConverterString) Lift(rb RustBufferI) string {
561
561
-
defer rb.Free()
562
562
-
reader := rb.AsReader()
563
563
-
b, err := io.ReadAll(reader)
564
564
-
if err != nil {
565
565
-
panic(fmt.Errorf("reading reader: %w", err))
566
566
-
}
567
567
-
return string(b)
568
568
-
}
569
569
-
570
570
-
func (FfiConverterString) Read(reader io.Reader) string {
571
571
-
length := readInt32(reader)
572
572
-
buffer := make([]byte, length)
573
573
-
read_length, err := reader.Read(buffer)
574
574
-
if err != nil {
575
575
-
panic(err)
576
576
-
}
577
577
-
if read_length != int(length) {
578
578
-
panic(fmt.Errorf("bad read length when reading string, expected %d, read %d", length, read_length))
579
579
-
}
580
580
-
return string(buffer)
581
581
-
}
582
582
-
583
583
-
func (FfiConverterString) Lower(value string) C.RustBuffer {
584
584
-
return stringToRustBuffer(value)
585
585
-
}
586
586
-
587
587
-
func (FfiConverterString) Write(writer io.Writer, value string) {
588
588
-
if len(value) > math.MaxInt32 {
589
589
-
panic("String is too large to fit into Int32")
590
590
-
}
591
591
-
592
592
-
writeInt32(writer, int32(len(value)))
593
593
-
write_length, err := io.WriteString(writer, value)
594
594
-
if err != nil {
595
595
-
panic(err)
596
596
-
}
597
597
-
if write_length != len(value) {
598
598
-
panic(fmt.Errorf("bad write length when writing string, expected %d, written %d", len(value), write_length))
599
599
-
}
600
600
-
}
601
601
-
602
602
-
type FfiDestroyerString struct{}
603
603
-
604
604
-
func (FfiDestroyerString) Destroy(_ string) {}
605
605
-
606
606
-
type FfiConverterBytes struct{}
607
607
-
608
608
-
var FfiConverterBytesINSTANCE = FfiConverterBytes{}
609
609
-
610
610
-
func (c FfiConverterBytes) Lower(value []byte) C.RustBuffer {
611
611
-
return LowerIntoRustBuffer[[]byte](c, value)
612
612
-
}
613
613
-
614
614
-
func (c FfiConverterBytes) Write(writer io.Writer, value []byte) {
615
615
-
if len(value) > math.MaxInt32 {
616
616
-
panic("[]byte is too large to fit into Int32")
617
617
-
}
618
618
-
619
619
-
writeInt32(writer, int32(len(value)))
620
620
-
write_length, err := writer.Write(value)
621
621
-
if err != nil {
622
622
-
panic(err)
623
623
-
}
624
624
-
if write_length != len(value) {
625
625
-
panic(fmt.Errorf("bad write length when writing []byte, expected %d, written %d", len(value), write_length))
626
626
-
}
627
627
-
}
628
628
-
629
629
-
func (c FfiConverterBytes) Lift(rb RustBufferI) []byte {
630
630
-
return LiftFromRustBuffer[[]byte](c, rb)
631
631
-
}
632
632
-
633
633
-
func (c FfiConverterBytes) Read(reader io.Reader) []byte {
634
634
-
length := readInt32(reader)
635
635
-
buffer := make([]byte, length)
636
636
-
read_length, err := reader.Read(buffer)
637
637
-
if err != nil {
638
638
-
panic(err)
639
639
-
}
640
640
-
if read_length != int(length) {
641
641
-
panic(fmt.Errorf("bad read length when reading []byte, expected %d, read %d", length, read_length))
642
642
-
}
643
643
-
return buffer
644
644
-
}
645
645
-
646
646
-
type FfiDestroyerBytes struct{}
647
647
-
648
648
-
func (FfiDestroyerBytes) Destroy(_ []byte) {}
649
649
-
650
650
-
// Below is an implementation of synchronization requirements outlined in the link.
651
651
-
// https://github.com/mozilla/uniffi-rs/blob/0dc031132d9493ca812c3af6e7dd60ad2ea95bf0/uniffi_bindgen/src/bindings/kotlin/templates/ObjectRuntime.kt#L31
652
652
-
653
653
-
type FfiObject struct {
654
654
-
pointer unsafe.Pointer
655
655
-
callCounter atomic.Int64
656
656
-
cloneFunction func(unsafe.Pointer, *C.RustCallStatus) unsafe.Pointer
657
657
-
freeFunction func(unsafe.Pointer, *C.RustCallStatus)
658
658
-
destroyed atomic.Bool
659
659
-
}
660
660
-
661
661
-
func newFfiObject(
662
662
-
pointer unsafe.Pointer,
663
663
-
cloneFunction func(unsafe.Pointer, *C.RustCallStatus) unsafe.Pointer,
664
664
-
freeFunction func(unsafe.Pointer, *C.RustCallStatus),
665
665
-
) FfiObject {
666
666
-
return FfiObject{
667
667
-
pointer: pointer,
668
668
-
cloneFunction: cloneFunction,
669
669
-
freeFunction: freeFunction,
670
670
-
}
671
671
-
}
672
672
-
673
673
-
func (ffiObject *FfiObject) incrementPointer(debugName string) unsafe.Pointer {
674
674
-
for {
675
675
-
counter := ffiObject.callCounter.Load()
676
676
-
if counter <= -1 {
677
677
-
panic(fmt.Errorf("%v object has already been destroyed", debugName))
678
678
-
}
679
679
-
if counter == math.MaxInt64 {
680
680
-
panic(fmt.Errorf("%v object call counter would overflow", debugName))
681
681
-
}
682
682
-
if ffiObject.callCounter.CompareAndSwap(counter, counter+1) {
683
683
-
break
684
684
-
}
685
685
-
}
686
686
-
687
687
-
return rustCall(func(status *C.RustCallStatus) unsafe.Pointer {
688
688
-
return ffiObject.cloneFunction(ffiObject.pointer, status)
689
689
-
})
690
690
-
}
691
691
-
692
692
-
func (ffiObject *FfiObject) decrementPointer() {
693
693
-
if ffiObject.callCounter.Add(-1) == -1 {
694
694
-
ffiObject.freeRustArcPtr()
695
695
-
}
696
696
-
}
697
697
-
698
698
-
func (ffiObject *FfiObject) destroy() {
699
699
-
if ffiObject.destroyed.CompareAndSwap(false, true) {
700
700
-
if ffiObject.callCounter.Add(-1) == -1 {
701
701
-
ffiObject.freeRustArcPtr()
702
702
-
}
703
703
-
}
704
704
-
}
705
705
-
706
706
-
func (ffiObject *FfiObject) freeRustArcPtr() {
707
707
-
rustCall(func(status *C.RustCallStatus) int32 {
708
708
-
ffiObject.freeFunction(ffiObject.pointer, status)
709
709
-
return 0
710
710
-
})
711
711
-
}
712
712
-
713
713
-
type DataHandler interface {
714
714
-
HandleData(peer *PublicKey, data []byte)
715
715
-
}
716
716
-
type DataHandlerImpl struct {
717
717
-
ffiObject FfiObject
718
718
-
}
719
719
-
720
720
-
func (_self *DataHandlerImpl) HandleData(peer *PublicKey, data []byte) {
721
721
-
_pointer := _self.ffiObject.incrementPointer("DataHandler")
722
722
-
defer _self.ffiObject.decrementPointer()
723
723
-
uniffiRustCallAsync[struct{}](
724
724
-
nil,
725
725
-
// completeFn
726
726
-
func(handle C.uint64_t, status *C.RustCallStatus) struct{} {
727
727
-
C.ffi_iroh_streamplace_rust_future_complete_void(handle, status)
728
728
-
return struct{}{}
729
729
-
},
730
730
-
// liftFn
731
731
-
func(_ struct{}) struct{} { return struct{}{} },
732
732
-
C.uniffi_iroh_streamplace_fn_method_datahandler_handle_data(
733
733
-
_pointer, FfiConverterPublicKeyINSTANCE.Lower(peer), FfiConverterBytesINSTANCE.Lower(data)),
734
734
-
// pollFn
735
735
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
736
736
-
C.ffi_iroh_streamplace_rust_future_poll_void(handle, continuation, data)
737
737
-
},
738
738
-
// freeFn
739
739
-
func(handle C.uint64_t) {
740
740
-
C.ffi_iroh_streamplace_rust_future_free_void(handle)
741
741
-
},
742
742
-
)
743
743
-
744
744
-
}
745
745
-
func (object *DataHandlerImpl) Destroy() {
746
746
-
runtime.SetFinalizer(object, nil)
747
747
-
object.ffiObject.destroy()
748
748
-
}
749
749
-
750
750
-
type FfiConverterDataHandler struct {
751
751
-
handleMap *concurrentHandleMap[DataHandler]
752
752
-
}
753
753
-
754
754
-
var FfiConverterDataHandlerINSTANCE = FfiConverterDataHandler{
755
755
-
handleMap: newConcurrentHandleMap[DataHandler](),
756
756
-
}
757
757
-
758
758
-
func (c FfiConverterDataHandler) Lift(pointer unsafe.Pointer) DataHandler {
759
759
-
result := &DataHandlerImpl{
760
760
-
newFfiObject(
761
761
-
pointer,
762
762
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer {
763
763
-
return C.uniffi_iroh_streamplace_fn_clone_datahandler(pointer, status)
764
764
-
},
765
765
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) {
766
766
-
C.uniffi_iroh_streamplace_fn_free_datahandler(pointer, status)
767
767
-
},
768
768
-
),
769
769
-
}
770
770
-
runtime.SetFinalizer(result, (*DataHandlerImpl).Destroy)
771
771
-
return result
772
772
-
}
773
773
-
774
774
-
func (c FfiConverterDataHandler) Read(reader io.Reader) DataHandler {
775
775
-
return c.Lift(unsafe.Pointer(uintptr(readUint64(reader))))
776
776
-
}
777
777
-
778
778
-
func (c FfiConverterDataHandler) Lower(value DataHandler) unsafe.Pointer {
779
779
-
// TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here,
780
780
-
// because the pointer will be decremented immediately after this function returns,
781
781
-
// and someone will be left holding onto a non-locked pointer.
782
782
-
pointer := unsafe.Pointer(uintptr(c.handleMap.insert(value)))
783
783
-
return pointer
784
784
-
785
785
-
}
786
786
-
787
787
-
func (c FfiConverterDataHandler) Write(writer io.Writer, value DataHandler) {
788
788
-
writeUint64(writer, uint64(uintptr(c.Lower(value))))
789
789
-
}
790
790
-
791
791
-
type FfiDestroyerDataHandler struct{}
792
792
-
793
793
-
func (_ FfiDestroyerDataHandler) Destroy(value DataHandler) {
794
794
-
if val, ok := value.(*DataHandlerImpl); ok {
795
795
-
val.Destroy()
796
796
-
} else {
797
797
-
panic("Expected *DataHandlerImpl")
798
798
-
}
799
799
-
}
800
800
-
801
801
-
type uniffiCallbackResult C.int8_t
802
802
-
803
803
-
const (
804
804
-
uniffiIdxCallbackFree uniffiCallbackResult = 0
805
805
-
uniffiCallbackResultSuccess uniffiCallbackResult = 0
806
806
-
uniffiCallbackResultError uniffiCallbackResult = 1
807
807
-
uniffiCallbackUnexpectedResultError uniffiCallbackResult = 2
808
808
-
uniffiCallbackCancelled uniffiCallbackResult = 3
809
809
-
)
810
810
-
811
811
-
type concurrentHandleMap[T any] struct {
812
812
-
handles map[uint64]T
813
813
-
currentHandle uint64
814
814
-
lock sync.RWMutex
815
815
-
}
816
816
-
817
817
-
func newConcurrentHandleMap[T any]() *concurrentHandleMap[T] {
818
818
-
return &concurrentHandleMap[T]{
819
819
-
handles: map[uint64]T{},
820
820
-
}
821
821
-
}
822
822
-
823
823
-
func (cm *concurrentHandleMap[T]) insert(obj T) uint64 {
824
824
-
cm.lock.Lock()
825
825
-
defer cm.lock.Unlock()
826
826
-
827
827
-
cm.currentHandle = cm.currentHandle + 1
828
828
-
cm.handles[cm.currentHandle] = obj
829
829
-
return cm.currentHandle
830
830
-
}
831
831
-
832
832
-
func (cm *concurrentHandleMap[T]) remove(handle uint64) {
833
833
-
cm.lock.Lock()
834
834
-
defer cm.lock.Unlock()
835
835
-
836
836
-
delete(cm.handles, handle)
837
837
-
}
838
838
-
839
839
-
func (cm *concurrentHandleMap[T]) tryGet(handle uint64) (T, bool) {
840
840
-
cm.lock.RLock()
841
841
-
defer cm.lock.RUnlock()
842
842
-
843
843
-
val, ok := cm.handles[handle]
844
844
-
return val, ok
845
845
-
}
846
846
-
847
847
-
//export iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerMethod0
848
848
-
func iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerMethod0(uniffiHandle C.uint64_t, peer unsafe.Pointer, data C.RustBuffer, uniffiFutureCallback C.UniffiForeignFutureCompleteVoid, uniffiCallbackData C.uint64_t, uniffiOutReturn *C.UniffiForeignFuture) {
849
849
-
handle := uint64(uniffiHandle)
850
850
-
uniffiObj, ok := FfiConverterDataHandlerINSTANCE.handleMap.tryGet(handle)
851
851
-
if !ok {
852
852
-
panic(fmt.Errorf("no callback in handle map: %d", handle))
853
853
-
}
854
854
-
855
855
-
result := make(chan C.UniffiForeignFutureStructVoid, 1)
856
856
-
cancel := make(chan struct{}, 1)
857
857
-
guardHandle := cgo.NewHandle(cancel)
858
858
-
*uniffiOutReturn = C.UniffiForeignFuture{
859
859
-
handle: C.uint64_t(guardHandle),
860
860
-
free: C.UniffiForeignFutureFree(C.iroh_streamplace_uniffiFreeGorutine),
861
861
-
}
862
862
-
863
863
-
// Wait for compleation or cancel
864
864
-
go func() {
865
865
-
select {
866
866
-
case <-cancel:
867
867
-
case res := <-result:
868
868
-
C.call_UniffiForeignFutureCompleteVoid(uniffiFutureCallback, uniffiCallbackData, res)
869
869
-
}
870
870
-
}()
871
871
-
872
872
-
// Eval callback asynchroniously
873
873
-
go func() {
874
874
-
asyncResult := &C.UniffiForeignFutureStructVoid{}
875
875
-
defer func() {
876
876
-
result <- *asyncResult
877
877
-
}()
878
878
-
879
879
-
uniffiObj.HandleData(
880
880
-
FfiConverterPublicKeyINSTANCE.Lift(peer),
881
881
-
FfiConverterBytesINSTANCE.Lift(GoRustBuffer{
882
882
-
inner: data,
883
883
-
}),
884
884
-
)
885
885
-
886
886
-
}()
887
887
-
}
888
888
-
889
889
-
var UniffiVTableCallbackInterfaceDataHandlerINSTANCE = C.UniffiVTableCallbackInterfaceDataHandler{
890
890
-
handleData: (C.UniffiCallbackInterfaceDataHandlerMethod0)(C.iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerMethod0),
891
891
-
892
892
-
uniffiFree: (C.UniffiCallbackInterfaceFree)(C.iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerFree),
893
893
-
}
894
894
-
895
895
-
//export iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerFree
896
896
-
func iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerFree(handle C.uint64_t) {
897
897
-
FfiConverterDataHandlerINSTANCE.handleMap.remove(uint64(handle))
898
898
-
}
899
899
-
900
900
-
func (c FfiConverterDataHandler) register() {
901
901
-
C.uniffi_iroh_streamplace_fn_init_callback_vtable_datahandler(&UniffiVTableCallbackInterfaceDataHandlerINSTANCE)
902
902
-
}
903
903
-
904
904
-
type EndpointInterface interface {
905
905
-
NodeAddr() *NodeAddr
906
906
-
}
907
907
-
type Endpoint struct {
908
908
-
ffiObject FfiObject
909
909
-
}
910
910
-
911
911
-
// Create a new endpoint.
912
912
-
func NewEndpoint() (*Endpoint, *Error) {
913
913
-
res, err := uniffiRustCallAsync[Error](
914
914
-
FfiConverterErrorINSTANCE,
915
915
-
// completeFn
916
916
-
func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer {
917
917
-
res := C.ffi_iroh_streamplace_rust_future_complete_pointer(handle, status)
918
918
-
return res
919
919
-
},
920
920
-
// liftFn
921
921
-
func(ffi unsafe.Pointer) *Endpoint {
922
922
-
return FfiConverterEndpointINSTANCE.Lift(ffi)
923
923
-
},
924
924
-
C.uniffi_iroh_streamplace_fn_constructor_endpoint_new(),
925
925
-
// pollFn
926
926
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
927
927
-
C.ffi_iroh_streamplace_rust_future_poll_pointer(handle, continuation, data)
928
928
-
},
929
929
-
// freeFn
930
930
-
func(handle C.uint64_t) {
931
931
-
C.ffi_iroh_streamplace_rust_future_free_pointer(handle)
932
932
-
},
933
933
-
)
934
934
-
935
935
-
return res, err
936
936
-
}
937
937
-
938
938
-
func (_self *Endpoint) NodeAddr() *NodeAddr {
939
939
-
_pointer := _self.ffiObject.incrementPointer("*Endpoint")
940
940
-
defer _self.ffiObject.decrementPointer()
941
941
-
res, _ := uniffiRustCallAsync[struct{}](
942
942
-
nil,
943
943
-
// completeFn
944
944
-
func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer {
945
945
-
res := C.ffi_iroh_streamplace_rust_future_complete_pointer(handle, status)
946
946
-
return res
947
947
-
},
948
948
-
// liftFn
949
949
-
func(ffi unsafe.Pointer) *NodeAddr {
950
950
-
return FfiConverterNodeAddrINSTANCE.Lift(ffi)
951
951
-
},
952
952
-
C.uniffi_iroh_streamplace_fn_method_endpoint_node_addr(
953
953
-
_pointer),
954
954
-
// pollFn
955
955
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
956
956
-
C.ffi_iroh_streamplace_rust_future_poll_pointer(handle, continuation, data)
957
957
-
},
958
958
-
// freeFn
959
959
-
func(handle C.uint64_t) {
960
960
-
C.ffi_iroh_streamplace_rust_future_free_pointer(handle)
961
961
-
},
962
962
-
)
963
963
-
964
964
-
return res
965
965
-
}
966
966
-
func (object *Endpoint) Destroy() {
967
967
-
runtime.SetFinalizer(object, nil)
968
968
-
object.ffiObject.destroy()
969
969
-
}
970
970
-
971
971
-
type FfiConverterEndpoint struct{}
972
972
-
973
973
-
var FfiConverterEndpointINSTANCE = FfiConverterEndpoint{}
974
974
-
975
975
-
func (c FfiConverterEndpoint) Lift(pointer unsafe.Pointer) *Endpoint {
976
976
-
result := &Endpoint{
977
977
-
newFfiObject(
978
978
-
pointer,
979
979
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer {
980
980
-
return C.uniffi_iroh_streamplace_fn_clone_endpoint(pointer, status)
981
981
-
},
982
982
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) {
983
983
-
C.uniffi_iroh_streamplace_fn_free_endpoint(pointer, status)
984
984
-
},
985
985
-
),
986
986
-
}
987
987
-
runtime.SetFinalizer(result, (*Endpoint).Destroy)
988
988
-
return result
989
989
-
}
990
990
-
991
991
-
func (c FfiConverterEndpoint) Read(reader io.Reader) *Endpoint {
992
992
-
return c.Lift(unsafe.Pointer(uintptr(readUint64(reader))))
993
993
-
}
994
994
-
995
995
-
func (c FfiConverterEndpoint) Lower(value *Endpoint) unsafe.Pointer {
996
996
-
// TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here,
997
997
-
// because the pointer will be decremented immediately after this function returns,
998
998
-
// and someone will be left holding onto a non-locked pointer.
999
999
-
pointer := value.ffiObject.incrementPointer("*Endpoint")
1000
1000
-
defer value.ffiObject.decrementPointer()
1001
1001
-
return pointer
1002
1002
-
1003
1003
-
}
1004
1004
-
1005
1005
-
func (c FfiConverterEndpoint) Write(writer io.Writer, value *Endpoint) {
1006
1006
-
writeUint64(writer, uint64(uintptr(c.Lower(value))))
1007
1007
-
}
1008
1008
-
1009
1009
-
type FfiDestroyerEndpoint struct{}
1010
1010
-
1011
1011
-
func (_ FfiDestroyerEndpoint) Destroy(value *Endpoint) {
1012
1012
-
value.Destroy()
1013
1013
-
}
1014
1014
-
1015
1015
-
// A peer and it's addressing information.
1016
1016
-
type NodeAddrInterface interface {
1017
1017
-
// Get the direct addresses of this peer.
1018
1018
-
DirectAddresses() []string
1019
1019
-
// Returns true if both NodeAddr's have the same values
1020
1020
-
Equal(other *NodeAddr) bool
1021
1021
-
NodeId() *PublicKey
1022
1022
-
// Get the home relay URL for this peer
1023
1023
-
RelayUrl() *string
1024
1024
-
}
1025
1025
-
1026
1026
-
// A peer and it's addressing information.
1027
1027
-
type NodeAddr struct {
1028
1028
-
ffiObject FfiObject
1029
1029
-
}
1030
1030
-
1031
1031
-
// Create a new [`NodeAddr`] with empty [`AddrInfo`].
1032
1032
-
func NewNodeAddr(nodeId *PublicKey, derpUrl *string, addresses []string) *NodeAddr {
1033
1033
-
return FfiConverterNodeAddrINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
1034
1034
-
return C.uniffi_iroh_streamplace_fn_constructor_nodeaddr_new(FfiConverterPublicKeyINSTANCE.Lower(nodeId), FfiConverterOptionalStringINSTANCE.Lower(derpUrl), FfiConverterSequenceStringINSTANCE.Lower(addresses), _uniffiStatus)
1035
1035
-
}))
1036
1036
-
}
1037
1037
-
1038
1038
-
// Get the direct addresses of this peer.
1039
1039
-
func (_self *NodeAddr) DirectAddresses() []string {
1040
1040
-
_pointer := _self.ffiObject.incrementPointer("*NodeAddr")
1041
1041
-
defer _self.ffiObject.decrementPointer()
1042
1042
-
return FfiConverterSequenceStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI {
1043
1043
-
return GoRustBuffer{
1044
1044
-
inner: C.uniffi_iroh_streamplace_fn_method_nodeaddr_direct_addresses(
1045
1045
-
_pointer, _uniffiStatus),
1046
1046
-
}
1047
1047
-
}))
1048
1048
-
}
1049
1049
-
1050
1050
-
// Returns true if both NodeAddr's have the same values
1051
1051
-
func (_self *NodeAddr) Equal(other *NodeAddr) bool {
1052
1052
-
_pointer := _self.ffiObject.incrementPointer("*NodeAddr")
1053
1053
-
defer _self.ffiObject.decrementPointer()
1054
1054
-
return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t {
1055
1055
-
return C.uniffi_iroh_streamplace_fn_method_nodeaddr_equal(
1056
1056
-
_pointer, FfiConverterNodeAddrINSTANCE.Lower(other), _uniffiStatus)
1057
1057
-
}))
1058
1058
-
}
1059
1059
-
1060
1060
-
func (_self *NodeAddr) NodeId() *PublicKey {
1061
1061
-
_pointer := _self.ffiObject.incrementPointer("*NodeAddr")
1062
1062
-
defer _self.ffiObject.decrementPointer()
1063
1063
-
return FfiConverterPublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
1064
1064
-
return C.uniffi_iroh_streamplace_fn_method_nodeaddr_node_id(
1065
1065
-
_pointer, _uniffiStatus)
1066
1066
-
}))
1067
1067
-
}
1068
1068
-
1069
1069
-
// Get the home relay URL for this peer
1070
1070
-
func (_self *NodeAddr) RelayUrl() *string {
1071
1071
-
_pointer := _self.ffiObject.incrementPointer("*NodeAddr")
1072
1072
-
defer _self.ffiObject.decrementPointer()
1073
1073
-
return FfiConverterOptionalStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI {
1074
1074
-
return GoRustBuffer{
1075
1075
-
inner: C.uniffi_iroh_streamplace_fn_method_nodeaddr_relay_url(
1076
1076
-
_pointer, _uniffiStatus),
1077
1077
-
}
1078
1078
-
}))
1079
1079
-
}
1080
1080
-
func (object *NodeAddr) Destroy() {
1081
1081
-
runtime.SetFinalizer(object, nil)
1082
1082
-
object.ffiObject.destroy()
1083
1083
-
}
1084
1084
-
1085
1085
-
type FfiConverterNodeAddr struct{}
1086
1086
-
1087
1087
-
var FfiConverterNodeAddrINSTANCE = FfiConverterNodeAddr{}
1088
1088
-
1089
1089
-
func (c FfiConverterNodeAddr) Lift(pointer unsafe.Pointer) *NodeAddr {
1090
1090
-
result := &NodeAddr{
1091
1091
-
newFfiObject(
1092
1092
-
pointer,
1093
1093
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer {
1094
1094
-
return C.uniffi_iroh_streamplace_fn_clone_nodeaddr(pointer, status)
1095
1095
-
},
1096
1096
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) {
1097
1097
-
C.uniffi_iroh_streamplace_fn_free_nodeaddr(pointer, status)
1098
1098
-
},
1099
1099
-
),
1100
1100
-
}
1101
1101
-
runtime.SetFinalizer(result, (*NodeAddr).Destroy)
1102
1102
-
return result
1103
1103
-
}
1104
1104
-
1105
1105
-
func (c FfiConverterNodeAddr) Read(reader io.Reader) *NodeAddr {
1106
1106
-
return c.Lift(unsafe.Pointer(uintptr(readUint64(reader))))
1107
1107
-
}
1108
1108
-
1109
1109
-
func (c FfiConverterNodeAddr) Lower(value *NodeAddr) unsafe.Pointer {
1110
1110
-
// TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here,
1111
1111
-
// because the pointer will be decremented immediately after this function returns,
1112
1112
-
// and someone will be left holding onto a non-locked pointer.
1113
1113
-
pointer := value.ffiObject.incrementPointer("*NodeAddr")
1114
1114
-
defer value.ffiObject.decrementPointer()
1115
1115
-
return pointer
1116
1116
-
1117
1117
-
}
1118
1118
-
1119
1119
-
func (c FfiConverterNodeAddr) Write(writer io.Writer, value *NodeAddr) {
1120
1120
-
writeUint64(writer, uint64(uintptr(c.Lower(value))))
1121
1121
-
}
1122
1122
-
1123
1123
-
type FfiDestroyerNodeAddr struct{}
1124
1124
-
1125
1125
-
func (_ FfiDestroyerNodeAddr) Destroy(value *NodeAddr) {
1126
1126
-
value.Destroy()
1127
1127
-
}
1128
1128
-
1129
1129
-
// A public key.
1130
1130
-
//
1131
1131
-
// The key itself is just a 32 byte array, but a key has associated crypto
1132
1132
-
// information that is cached for performance reasons.
1133
1133
-
type PublicKeyInterface interface {
1134
1134
-
// Returns true if the PublicKeys are equal
1135
1135
-
Equal(other *PublicKey) bool
1136
1136
-
// Convert to a base32 string limited to the first 10 bytes for a friendly string
1137
1137
-
// representation of the key.
1138
1138
-
FmtShort() string
1139
1139
-
// Express the PublicKey as a byte array
1140
1140
-
ToBytes() []byte
1141
1141
-
}
1142
1142
-
1143
1143
-
// A public key.
1144
1144
-
//
1145
1145
-
// The key itself is just a 32 byte array, but a key has associated crypto
1146
1146
-
// information that is cached for performance reasons.
1147
1147
-
type PublicKey struct {
1148
1148
-
ffiObject FfiObject
1149
1149
-
}
1150
1150
-
1151
1151
-
// Make a PublicKey from byte array
1152
1152
-
func PublicKeyFromBytes(bytes []byte) (*PublicKey, *Error) {
1153
1153
-
_uniffiRV, _uniffiErr := rustCallWithError[Error](FfiConverterError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
1154
1154
-
return C.uniffi_iroh_streamplace_fn_constructor_publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes), _uniffiStatus)
1155
1155
-
})
1156
1156
-
if _uniffiErr != nil {
1157
1157
-
var _uniffiDefaultValue *PublicKey
1158
1158
-
return _uniffiDefaultValue, _uniffiErr
1159
1159
-
} else {
1160
1160
-
return FfiConverterPublicKeyINSTANCE.Lift(_uniffiRV), _uniffiErr
1161
1161
-
}
1162
1162
-
}
1163
1163
-
1164
1164
-
// Make a PublicKey from base32 string
1165
1165
-
func PublicKeyFromString(s string) (*PublicKey, *Error) {
1166
1166
-
_uniffiRV, _uniffiErr := rustCallWithError[Error](FfiConverterError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
1167
1167
-
return C.uniffi_iroh_streamplace_fn_constructor_publickey_from_string(FfiConverterStringINSTANCE.Lower(s), _uniffiStatus)
1168
1168
-
})
1169
1169
-
if _uniffiErr != nil {
1170
1170
-
var _uniffiDefaultValue *PublicKey
1171
1171
-
return _uniffiDefaultValue, _uniffiErr
1172
1172
-
} else {
1173
1173
-
return FfiConverterPublicKeyINSTANCE.Lift(_uniffiRV), _uniffiErr
1174
1174
-
}
1175
1175
-
}
1176
1176
-
1177
1177
-
// Returns true if the PublicKeys are equal
1178
1178
-
func (_self *PublicKey) Equal(other *PublicKey) bool {
1179
1179
-
_pointer := _self.ffiObject.incrementPointer("*PublicKey")
1180
1180
-
defer _self.ffiObject.decrementPointer()
1181
1181
-
return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t {
1182
1182
-
return C.uniffi_iroh_streamplace_fn_method_publickey_equal(
1183
1183
-
_pointer, FfiConverterPublicKeyINSTANCE.Lower(other), _uniffiStatus)
1184
1184
-
}))
1185
1185
-
}
1186
1186
-
1187
1187
-
// Convert to a base32 string limited to the first 10 bytes for a friendly string
1188
1188
-
// representation of the key.
1189
1189
-
func (_self *PublicKey) FmtShort() string {
1190
1190
-
_pointer := _self.ffiObject.incrementPointer("*PublicKey")
1191
1191
-
defer _self.ffiObject.decrementPointer()
1192
1192
-
return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI {
1193
1193
-
return GoRustBuffer{
1194
1194
-
inner: C.uniffi_iroh_streamplace_fn_method_publickey_fmt_short(
1195
1195
-
_pointer, _uniffiStatus),
1196
1196
-
}
1197
1197
-
}))
1198
1198
-
}
1199
1199
-
1200
1200
-
// Express the PublicKey as a byte array
1201
1201
-
func (_self *PublicKey) ToBytes() []byte {
1202
1202
-
_pointer := _self.ffiObject.incrementPointer("*PublicKey")
1203
1203
-
defer _self.ffiObject.decrementPointer()
1204
1204
-
return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI {
1205
1205
-
return GoRustBuffer{
1206
1206
-
inner: C.uniffi_iroh_streamplace_fn_method_publickey_to_bytes(
1207
1207
-
_pointer, _uniffiStatus),
1208
1208
-
}
1209
1209
-
}))
1210
1210
-
}
1211
1211
-
1212
1212
-
func (_self *PublicKey) String() string {
1213
1213
-
_pointer := _self.ffiObject.incrementPointer("*PublicKey")
1214
1214
-
defer _self.ffiObject.decrementPointer()
1215
1215
-
return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI {
1216
1216
-
return GoRustBuffer{
1217
1217
-
inner: C.uniffi_iroh_streamplace_fn_method_publickey_uniffi_trait_display(
1218
1218
-
_pointer, _uniffiStatus),
1219
1219
-
}
1220
1220
-
}))
1221
1221
-
}
1222
1222
-
1223
1223
-
func (object *PublicKey) Destroy() {
1224
1224
-
runtime.SetFinalizer(object, nil)
1225
1225
-
object.ffiObject.destroy()
1226
1226
-
}
1227
1227
-
1228
1228
-
type FfiConverterPublicKey struct{}
1229
1229
-
1230
1230
-
var FfiConverterPublicKeyINSTANCE = FfiConverterPublicKey{}
1231
1231
-
1232
1232
-
func (c FfiConverterPublicKey) Lift(pointer unsafe.Pointer) *PublicKey {
1233
1233
-
result := &PublicKey{
1234
1234
-
newFfiObject(
1235
1235
-
pointer,
1236
1236
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer {
1237
1237
-
return C.uniffi_iroh_streamplace_fn_clone_publickey(pointer, status)
1238
1238
-
},
1239
1239
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) {
1240
1240
-
C.uniffi_iroh_streamplace_fn_free_publickey(pointer, status)
1241
1241
-
},
1242
1242
-
),
1243
1243
-
}
1244
1244
-
runtime.SetFinalizer(result, (*PublicKey).Destroy)
1245
1245
-
return result
1246
1246
-
}
1247
1247
-
1248
1248
-
func (c FfiConverterPublicKey) Read(reader io.Reader) *PublicKey {
1249
1249
-
return c.Lift(unsafe.Pointer(uintptr(readUint64(reader))))
1250
1250
-
}
1251
1251
-
1252
1252
-
func (c FfiConverterPublicKey) Lower(value *PublicKey) unsafe.Pointer {
1253
1253
-
// TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here,
1254
1254
-
// because the pointer will be decremented immediately after this function returns,
1255
1255
-
// and someone will be left holding onto a non-locked pointer.
1256
1256
-
pointer := value.ffiObject.incrementPointer("*PublicKey")
1257
1257
-
defer value.ffiObject.decrementPointer()
1258
1258
-
return pointer
1259
1259
-
1260
1260
-
}
1261
1261
-
1262
1262
-
func (c FfiConverterPublicKey) Write(writer io.Writer, value *PublicKey) {
1263
1263
-
writeUint64(writer, uint64(uintptr(c.Lower(value))))
1264
1264
-
}
1265
1265
-
1266
1266
-
type FfiDestroyerPublicKey struct{}
1267
1267
-
1268
1268
-
func (_ FfiDestroyerPublicKey) Destroy(value *PublicKey) {
1269
1269
-
value.Destroy()
1270
1270
-
}
1271
1271
-
1272
1272
-
type ReceiverInterface interface {
1273
1273
-
NodeAddr() *NodeAddr
1274
1274
-
}
1275
1275
-
type Receiver struct {
1276
1276
-
ffiObject FfiObject
1277
1277
-
}
1278
1278
-
1279
1279
-
// Create a new receiver.
1280
1280
-
func NewReceiver(endpoint *Endpoint, handler DataHandler) (*Receiver, *Error) {
1281
1281
-
res, err := uniffiRustCallAsync[Error](
1282
1282
-
FfiConverterErrorINSTANCE,
1283
1283
-
// completeFn
1284
1284
-
func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer {
1285
1285
-
res := C.ffi_iroh_streamplace_rust_future_complete_pointer(handle, status)
1286
1286
-
return res
1287
1287
-
},
1288
1288
-
// liftFn
1289
1289
-
func(ffi unsafe.Pointer) *Receiver {
1290
1290
-
return FfiConverterReceiverINSTANCE.Lift(ffi)
1291
1291
-
},
1292
1292
-
C.uniffi_iroh_streamplace_fn_constructor_receiver_new(FfiConverterEndpointINSTANCE.Lower(endpoint), FfiConverterDataHandlerINSTANCE.Lower(handler)),
1293
1293
-
// pollFn
1294
1294
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
1295
1295
-
C.ffi_iroh_streamplace_rust_future_poll_pointer(handle, continuation, data)
1296
1296
-
},
1297
1297
-
// freeFn
1298
1298
-
func(handle C.uint64_t) {
1299
1299
-
C.ffi_iroh_streamplace_rust_future_free_pointer(handle)
1300
1300
-
},
1301
1301
-
)
1302
1302
-
1303
1303
-
return res, err
1304
1304
-
}
1305
1305
-
1306
1306
-
func (_self *Receiver) NodeAddr() *NodeAddr {
1307
1307
-
_pointer := _self.ffiObject.incrementPointer("*Receiver")
1308
1308
-
defer _self.ffiObject.decrementPointer()
1309
1309
-
res, _ := uniffiRustCallAsync[struct{}](
1310
1310
-
nil,
1311
1311
-
// completeFn
1312
1312
-
func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer {
1313
1313
-
res := C.ffi_iroh_streamplace_rust_future_complete_pointer(handle, status)
1314
1314
-
return res
1315
1315
-
},
1316
1316
-
// liftFn
1317
1317
-
func(ffi unsafe.Pointer) *NodeAddr {
1318
1318
-
return FfiConverterNodeAddrINSTANCE.Lift(ffi)
1319
1319
-
},
1320
1320
-
C.uniffi_iroh_streamplace_fn_method_receiver_node_addr(
1321
1321
-
_pointer),
1322
1322
-
// pollFn
1323
1323
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
1324
1324
-
C.ffi_iroh_streamplace_rust_future_poll_pointer(handle, continuation, data)
1325
1325
-
},
1326
1326
-
// freeFn
1327
1327
-
func(handle C.uint64_t) {
1328
1328
-
C.ffi_iroh_streamplace_rust_future_free_pointer(handle)
1329
1329
-
},
1330
1330
-
)
1331
1331
-
1332
1332
-
return res
1333
1333
-
}
1334
1334
-
func (object *Receiver) Destroy() {
1335
1335
-
runtime.SetFinalizer(object, nil)
1336
1336
-
object.ffiObject.destroy()
1337
1337
-
}
1338
1338
-
1339
1339
-
type FfiConverterReceiver struct{}
1340
1340
-
1341
1341
-
var FfiConverterReceiverINSTANCE = FfiConverterReceiver{}
1342
1342
-
1343
1343
-
func (c FfiConverterReceiver) Lift(pointer unsafe.Pointer) *Receiver {
1344
1344
-
result := &Receiver{
1345
1345
-
newFfiObject(
1346
1346
-
pointer,
1347
1347
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer {
1348
1348
-
return C.uniffi_iroh_streamplace_fn_clone_receiver(pointer, status)
1349
1349
-
},
1350
1350
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) {
1351
1351
-
C.uniffi_iroh_streamplace_fn_free_receiver(pointer, status)
1352
1352
-
},
1353
1353
-
),
1354
1354
-
}
1355
1355
-
runtime.SetFinalizer(result, (*Receiver).Destroy)
1356
1356
-
return result
1357
1357
-
}
1358
1358
-
1359
1359
-
func (c FfiConverterReceiver) Read(reader io.Reader) *Receiver {
1360
1360
-
return c.Lift(unsafe.Pointer(uintptr(readUint64(reader))))
1361
1361
-
}
1362
1362
-
1363
1363
-
func (c FfiConverterReceiver) Lower(value *Receiver) unsafe.Pointer {
1364
1364
-
// TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here,
1365
1365
-
// because the pointer will be decremented immediately after this function returns,
1366
1366
-
// and someone will be left holding onto a non-locked pointer.
1367
1367
-
pointer := value.ffiObject.incrementPointer("*Receiver")
1368
1368
-
defer value.ffiObject.decrementPointer()
1369
1369
-
return pointer
1370
1370
-
1371
1371
-
}
1372
1372
-
1373
1373
-
func (c FfiConverterReceiver) Write(writer io.Writer, value *Receiver) {
1374
1374
-
writeUint64(writer, uint64(uintptr(c.Lower(value))))
1375
1375
-
}
1376
1376
-
1377
1377
-
type FfiDestroyerReceiver struct{}
1378
1378
-
1379
1379
-
func (_ FfiDestroyerReceiver) Destroy(value *Receiver) {
1380
1380
-
value.Destroy()
1381
1381
-
}
1382
1382
-
1383
1383
-
type SenderInterface interface {
1384
1384
-
AddPeer(addr *NodeAddr) *Error
1385
1385
-
NodeAddr() *NodeAddr
1386
1386
-
Send(nodeId *PublicKey, data []byte) *Error
1387
1387
-
}
1388
1388
-
type Sender struct {
1389
1389
-
ffiObject FfiObject
1390
1390
-
}
1391
1391
-
1392
1392
-
// Create a new sender.
1393
1393
-
func NewSender(endpoint *Endpoint) (*Sender, *Error) {
1394
1394
-
res, err := uniffiRustCallAsync[Error](
1395
1395
-
FfiConverterErrorINSTANCE,
1396
1396
-
// completeFn
1397
1397
-
func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer {
1398
1398
-
res := C.ffi_iroh_streamplace_rust_future_complete_pointer(handle, status)
1399
1399
-
return res
1400
1400
-
},
1401
1401
-
// liftFn
1402
1402
-
func(ffi unsafe.Pointer) *Sender {
1403
1403
-
return FfiConverterSenderINSTANCE.Lift(ffi)
1404
1404
-
},
1405
1405
-
C.uniffi_iroh_streamplace_fn_constructor_sender_new(FfiConverterEndpointINSTANCE.Lower(endpoint)),
1406
1406
-
// pollFn
1407
1407
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
1408
1408
-
C.ffi_iroh_streamplace_rust_future_poll_pointer(handle, continuation, data)
1409
1409
-
},
1410
1410
-
// freeFn
1411
1411
-
func(handle C.uint64_t) {
1412
1412
-
C.ffi_iroh_streamplace_rust_future_free_pointer(handle)
1413
1413
-
},
1414
1414
-
)
1415
1415
-
1416
1416
-
return res, err
1417
1417
-
}
1418
1418
-
1419
1419
-
func (_self *Sender) AddPeer(addr *NodeAddr) *Error {
1420
1420
-
_pointer := _self.ffiObject.incrementPointer("*Sender")
1421
1421
-
defer _self.ffiObject.decrementPointer()
1422
1422
-
_, err := uniffiRustCallAsync[Error](
1423
1423
-
FfiConverterErrorINSTANCE,
1424
1424
-
// completeFn
1425
1425
-
func(handle C.uint64_t, status *C.RustCallStatus) struct{} {
1426
1426
-
C.ffi_iroh_streamplace_rust_future_complete_void(handle, status)
1427
1427
-
return struct{}{}
1428
1428
-
},
1429
1429
-
// liftFn
1430
1430
-
func(_ struct{}) struct{} { return struct{}{} },
1431
1431
-
C.uniffi_iroh_streamplace_fn_method_sender_add_peer(
1432
1432
-
_pointer, FfiConverterNodeAddrINSTANCE.Lower(addr)),
1433
1433
-
// pollFn
1434
1434
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
1435
1435
-
C.ffi_iroh_streamplace_rust_future_poll_void(handle, continuation, data)
1436
1436
-
},
1437
1437
-
// freeFn
1438
1438
-
func(handle C.uint64_t) {
1439
1439
-
C.ffi_iroh_streamplace_rust_future_free_void(handle)
1440
1440
-
},
1441
1441
-
)
1442
1442
-
1443
1443
-
return err
1444
1444
-
}
1445
1445
-
1446
1446
-
func (_self *Sender) NodeAddr() *NodeAddr {
1447
1447
-
_pointer := _self.ffiObject.incrementPointer("*Sender")
1448
1448
-
defer _self.ffiObject.decrementPointer()
1449
1449
-
res, _ := uniffiRustCallAsync[struct{}](
1450
1450
-
nil,
1451
1451
-
// completeFn
1452
1452
-
func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer {
1453
1453
-
res := C.ffi_iroh_streamplace_rust_future_complete_pointer(handle, status)
1454
1454
-
return res
1455
1455
-
},
1456
1456
-
// liftFn
1457
1457
-
func(ffi unsafe.Pointer) *NodeAddr {
1458
1458
-
return FfiConverterNodeAddrINSTANCE.Lift(ffi)
1459
1459
-
},
1460
1460
-
C.uniffi_iroh_streamplace_fn_method_sender_node_addr(
1461
1461
-
_pointer),
1462
1462
-
// pollFn
1463
1463
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
1464
1464
-
C.ffi_iroh_streamplace_rust_future_poll_pointer(handle, continuation, data)
1465
1465
-
},
1466
1466
-
// freeFn
1467
1467
-
func(handle C.uint64_t) {
1468
1468
-
C.ffi_iroh_streamplace_rust_future_free_pointer(handle)
1469
1469
-
},
1470
1470
-
)
1471
1471
-
1472
1472
-
return res
1473
1473
-
}
1474
1474
-
1475
1475
-
func (_self *Sender) Send(nodeId *PublicKey, data []byte) *Error {
1476
1476
-
_pointer := _self.ffiObject.incrementPointer("*Sender")
1477
1477
-
defer _self.ffiObject.decrementPointer()
1478
1478
-
_, err := uniffiRustCallAsync[Error](
1479
1479
-
FfiConverterErrorINSTANCE,
1480
1480
-
// completeFn
1481
1481
-
func(handle C.uint64_t, status *C.RustCallStatus) struct{} {
1482
1482
-
C.ffi_iroh_streamplace_rust_future_complete_void(handle, status)
1483
1483
-
return struct{}{}
1484
1484
-
},
1485
1485
-
// liftFn
1486
1486
-
func(_ struct{}) struct{} { return struct{}{} },
1487
1487
-
C.uniffi_iroh_streamplace_fn_method_sender_send(
1488
1488
-
_pointer, FfiConverterPublicKeyINSTANCE.Lower(nodeId), FfiConverterBytesINSTANCE.Lower(data)),
1489
1489
-
// pollFn
1490
1490
-
func(handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
1491
1491
-
C.ffi_iroh_streamplace_rust_future_poll_void(handle, continuation, data)
1492
1492
-
},
1493
1493
-
// freeFn
1494
1494
-
func(handle C.uint64_t) {
1495
1495
-
C.ffi_iroh_streamplace_rust_future_free_void(handle)
1496
1496
-
},
1497
1497
-
)
1498
1498
-
1499
1499
-
return err
1500
1500
-
}
1501
1501
-
func (object *Sender) Destroy() {
1502
1502
-
runtime.SetFinalizer(object, nil)
1503
1503
-
object.ffiObject.destroy()
1504
1504
-
}
1505
1505
-
1506
1506
-
type FfiConverterSender struct{}
1507
1507
-
1508
1508
-
var FfiConverterSenderINSTANCE = FfiConverterSender{}
1509
1509
-
1510
1510
-
func (c FfiConverterSender) Lift(pointer unsafe.Pointer) *Sender {
1511
1511
-
result := &Sender{
1512
1512
-
newFfiObject(
1513
1513
-
pointer,
1514
1514
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer {
1515
1515
-
return C.uniffi_iroh_streamplace_fn_clone_sender(pointer, status)
1516
1516
-
},
1517
1517
-
func(pointer unsafe.Pointer, status *C.RustCallStatus) {
1518
1518
-
C.uniffi_iroh_streamplace_fn_free_sender(pointer, status)
1519
1519
-
},
1520
1520
-
),
1521
1521
-
}
1522
1522
-
runtime.SetFinalizer(result, (*Sender).Destroy)
1523
1523
-
return result
1524
1524
-
}
1525
1525
-
1526
1526
-
func (c FfiConverterSender) Read(reader io.Reader) *Sender {
1527
1527
-
return c.Lift(unsafe.Pointer(uintptr(readUint64(reader))))
1528
1528
-
}
1529
1529
-
1530
1530
-
func (c FfiConverterSender) Lower(value *Sender) unsafe.Pointer {
1531
1531
-
// TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here,
1532
1532
-
// because the pointer will be decremented immediately after this function returns,
1533
1533
-
// and someone will be left holding onto a non-locked pointer.
1534
1534
-
pointer := value.ffiObject.incrementPointer("*Sender")
1535
1535
-
defer value.ffiObject.decrementPointer()
1536
1536
-
return pointer
1537
1537
-
1538
1538
-
}
1539
1539
-
1540
1540
-
func (c FfiConverterSender) Write(writer io.Writer, value *Sender) {
1541
1541
-
writeUint64(writer, uint64(uintptr(c.Lower(value))))
1542
1542
-
}
1543
1543
-
1544
1544
-
type FfiDestroyerSender struct{}
1545
1545
-
1546
1546
-
func (_ FfiDestroyerSender) Destroy(value *Sender) {
1547
1547
-
value.Destroy()
1548
1548
-
}
1549
1549
-
1550
1550
-
// An Error.
1551
1551
-
type Error struct {
1552
1552
-
err error
1553
1553
-
}
1554
1554
-
1555
1555
-
// Convience method to turn *Error into error
1556
1556
-
// Avoiding treating nil pointer as non nil error interface
1557
1557
-
func (err *Error) AsError() error {
1558
1558
-
if err == nil {
1559
1559
-
return nil
1560
1560
-
} else {
1561
1561
-
return err
1562
1562
-
}
1563
1563
-
}
1564
1564
-
1565
1565
-
func (err Error) Error() string {
1566
1566
-
return fmt.Sprintf("Error: %s", err.err.Error())
1567
1567
-
}
1568
1568
-
1569
1569
-
func (err Error) Unwrap() error {
1570
1570
-
return err.err
1571
1571
-
}
1572
1572
-
1573
1573
-
// Err* are used for checking error type with `errors.Is`
1574
1574
-
var ErrErrorIrohBind = fmt.Errorf("ErrorIrohBind")
1575
1575
-
var ErrErrorInvalidUrl = fmt.Errorf("ErrorInvalidUrl")
1576
1576
-
var ErrErrorIrohConnect = fmt.Errorf("ErrorIrohConnect")
1577
1577
-
var ErrErrorInvalidNetworkAddress = fmt.Errorf("ErrorInvalidNetworkAddress")
1578
1578
-
var ErrErrorOpenStream = fmt.Errorf("ErrorOpenStream")
1579
1579
-
var ErrErrorSendMessage = fmt.Errorf("ErrorSendMessage")
1580
1580
-
var ErrErrorNewConnection = fmt.Errorf("ErrorNewConnection")
1581
1581
-
var ErrErrorMissingConnection = fmt.Errorf("ErrorMissingConnection")
1582
1582
-
var ErrErrorInvalidPublicKey = fmt.Errorf("ErrorInvalidPublicKey")
1583
1583
-
1584
1584
-
// Variant structs
1585
1585
-
type ErrorIrohBind struct {
1586
1586
-
message string
1587
1587
-
}
1588
1588
-
1589
1589
-
func NewErrorIrohBind() *Error {
1590
1590
-
return &Error{err: &ErrorIrohBind{}}
1591
1591
-
}
1592
1592
-
1593
1593
-
func (e ErrorIrohBind) destroy() {
1594
1594
-
}
1595
1595
-
1596
1596
-
func (err ErrorIrohBind) Error() string {
1597
1597
-
return fmt.Sprintf("IrohBind: %s", err.message)
1598
1598
-
}
1599
1599
-
1600
1600
-
func (self ErrorIrohBind) Is(target error) bool {
1601
1601
-
return target == ErrErrorIrohBind
1602
1602
-
}
1603
1603
-
1604
1604
-
type ErrorInvalidUrl struct {
1605
1605
-
message string
1606
1606
-
}
1607
1607
-
1608
1608
-
func NewErrorInvalidUrl() *Error {
1609
1609
-
return &Error{err: &ErrorInvalidUrl{}}
1610
1610
-
}
1611
1611
-
1612
1612
-
func (e ErrorInvalidUrl) destroy() {
1613
1613
-
}
1614
1614
-
1615
1615
-
func (err ErrorInvalidUrl) Error() string {
1616
1616
-
return fmt.Sprintf("InvalidUrl: %s", err.message)
1617
1617
-
}
1618
1618
-
1619
1619
-
func (self ErrorInvalidUrl) Is(target error) bool {
1620
1620
-
return target == ErrErrorInvalidUrl
1621
1621
-
}
1622
1622
-
1623
1623
-
type ErrorIrohConnect struct {
1624
1624
-
message string
1625
1625
-
}
1626
1626
-
1627
1627
-
func NewErrorIrohConnect() *Error {
1628
1628
-
return &Error{err: &ErrorIrohConnect{}}
1629
1629
-
}
1630
1630
-
1631
1631
-
func (e ErrorIrohConnect) destroy() {
1632
1632
-
}
1633
1633
-
1634
1634
-
func (err ErrorIrohConnect) Error() string {
1635
1635
-
return fmt.Sprintf("IrohConnect: %s", err.message)
1636
1636
-
}
1637
1637
-
1638
1638
-
func (self ErrorIrohConnect) Is(target error) bool {
1639
1639
-
return target == ErrErrorIrohConnect
1640
1640
-
}
1641
1641
-
1642
1642
-
type ErrorInvalidNetworkAddress struct {
1643
1643
-
message string
1644
1644
-
}
1645
1645
-
1646
1646
-
func NewErrorInvalidNetworkAddress() *Error {
1647
1647
-
return &Error{err: &ErrorInvalidNetworkAddress{}}
1648
1648
-
}
1649
1649
-
1650
1650
-
func (e ErrorInvalidNetworkAddress) destroy() {
1651
1651
-
}
1652
1652
-
1653
1653
-
func (err ErrorInvalidNetworkAddress) Error() string {
1654
1654
-
return fmt.Sprintf("InvalidNetworkAddress: %s", err.message)
1655
1655
-
}
1656
1656
-
1657
1657
-
func (self ErrorInvalidNetworkAddress) Is(target error) bool {
1658
1658
-
return target == ErrErrorInvalidNetworkAddress
1659
1659
-
}
1660
1660
-
1661
1661
-
type ErrorOpenStream struct {
1662
1662
-
message string
1663
1663
-
}
1664
1664
-
1665
1665
-
func NewErrorOpenStream() *Error {
1666
1666
-
return &Error{err: &ErrorOpenStream{}}
1667
1667
-
}
1668
1668
-
1669
1669
-
func (e ErrorOpenStream) destroy() {
1670
1670
-
}
1671
1671
-
1672
1672
-
func (err ErrorOpenStream) Error() string {
1673
1673
-
return fmt.Sprintf("OpenStream: %s", err.message)
1674
1674
-
}
1675
1675
-
1676
1676
-
func (self ErrorOpenStream) Is(target error) bool {
1677
1677
-
return target == ErrErrorOpenStream
1678
1678
-
}
1679
1679
-
1680
1680
-
type ErrorSendMessage struct {
1681
1681
-
message string
1682
1682
-
}
1683
1683
-
1684
1684
-
func NewErrorSendMessage() *Error {
1685
1685
-
return &Error{err: &ErrorSendMessage{}}
1686
1686
-
}
1687
1687
-
1688
1688
-
func (e ErrorSendMessage) destroy() {
1689
1689
-
}
1690
1690
-
1691
1691
-
func (err ErrorSendMessage) Error() string {
1692
1692
-
return fmt.Sprintf("SendMessage: %s", err.message)
1693
1693
-
}
1694
1694
-
1695
1695
-
func (self ErrorSendMessage) Is(target error) bool {
1696
1696
-
return target == ErrErrorSendMessage
1697
1697
-
}
1698
1698
-
1699
1699
-
type ErrorNewConnection struct {
1700
1700
-
message string
1701
1701
-
}
1702
1702
-
1703
1703
-
func NewErrorNewConnection() *Error {
1704
1704
-
return &Error{err: &ErrorNewConnection{}}
1705
1705
-
}
1706
1706
-
1707
1707
-
func (e ErrorNewConnection) destroy() {
1708
1708
-
}
1709
1709
-
1710
1710
-
func (err ErrorNewConnection) Error() string {
1711
1711
-
return fmt.Sprintf("NewConnection: %s", err.message)
1712
1712
-
}
1713
1713
-
1714
1714
-
func (self ErrorNewConnection) Is(target error) bool {
1715
1715
-
return target == ErrErrorNewConnection
1716
1716
-
}
1717
1717
-
1718
1718
-
type ErrorMissingConnection struct {
1719
1719
-
message string
1720
1720
-
}
1721
1721
-
1722
1722
-
func NewErrorMissingConnection() *Error {
1723
1723
-
return &Error{err: &ErrorMissingConnection{}}
1724
1724
-
}
1725
1725
-
1726
1726
-
func (e ErrorMissingConnection) destroy() {
1727
1727
-
}
1728
1728
-
1729
1729
-
func (err ErrorMissingConnection) Error() string {
1730
1730
-
return fmt.Sprintf("MissingConnection: %s", err.message)
1731
1731
-
}
1732
1732
-
1733
1733
-
func (self ErrorMissingConnection) Is(target error) bool {
1734
1734
-
return target == ErrErrorMissingConnection
1735
1735
-
}
1736
1736
-
1737
1737
-
type ErrorInvalidPublicKey struct {
1738
1738
-
message string
1739
1739
-
}
1740
1740
-
1741
1741
-
func NewErrorInvalidPublicKey() *Error {
1742
1742
-
return &Error{err: &ErrorInvalidPublicKey{}}
1743
1743
-
}
1744
1744
-
1745
1745
-
func (e ErrorInvalidPublicKey) destroy() {
1746
1746
-
}
1747
1747
-
1748
1748
-
func (err ErrorInvalidPublicKey) Error() string {
1749
1749
-
return fmt.Sprintf("InvalidPublicKey: %s", err.message)
1750
1750
-
}
1751
1751
-
1752
1752
-
func (self ErrorInvalidPublicKey) Is(target error) bool {
1753
1753
-
return target == ErrErrorInvalidPublicKey
1754
1754
-
}
1755
1755
-
1756
1756
-
type FfiConverterError struct{}
1757
1757
-
1758
1758
-
var FfiConverterErrorINSTANCE = FfiConverterError{}
1759
1759
-
1760
1760
-
func (c FfiConverterError) Lift(eb RustBufferI) *Error {
1761
1761
-
return LiftFromRustBuffer[*Error](c, eb)
1762
1762
-
}
1763
1763
-
1764
1764
-
func (c FfiConverterError) Lower(value *Error) C.RustBuffer {
1765
1765
-
return LowerIntoRustBuffer[*Error](c, value)
1766
1766
-
}
1767
1767
-
1768
1768
-
func (c FfiConverterError) Read(reader io.Reader) *Error {
1769
1769
-
errorID := readUint32(reader)
1770
1770
-
1771
1771
-
message := FfiConverterStringINSTANCE.Read(reader)
1772
1772
-
switch errorID {
1773
1773
-
case 1:
1774
1774
-
return &Error{&ErrorIrohBind{message}}
1775
1775
-
case 2:
1776
1776
-
return &Error{&ErrorInvalidUrl{message}}
1777
1777
-
case 3:
1778
1778
-
return &Error{&ErrorIrohConnect{message}}
1779
1779
-
case 4:
1780
1780
-
return &Error{&ErrorInvalidNetworkAddress{message}}
1781
1781
-
case 5:
1782
1782
-
return &Error{&ErrorOpenStream{message}}
1783
1783
-
case 6:
1784
1784
-
return &Error{&ErrorSendMessage{message}}
1785
1785
-
case 7:
1786
1786
-
return &Error{&ErrorNewConnection{message}}
1787
1787
-
case 8:
1788
1788
-
return &Error{&ErrorMissingConnection{message}}
1789
1789
-
case 9:
1790
1790
-
return &Error{&ErrorInvalidPublicKey{message}}
1791
1791
-
default:
1792
1792
-
panic(fmt.Sprintf("Unknown error code %d in FfiConverterError.Read()", errorID))
1793
1793
-
}
1794
1794
-
1795
1795
-
}
1796
1796
-
1797
1797
-
func (c FfiConverterError) Write(writer io.Writer, value *Error) {
1798
1798
-
switch variantValue := value.err.(type) {
1799
1799
-
case *ErrorIrohBind:
1800
1800
-
writeInt32(writer, 1)
1801
1801
-
case *ErrorInvalidUrl:
1802
1802
-
writeInt32(writer, 2)
1803
1803
-
case *ErrorIrohConnect:
1804
1804
-
writeInt32(writer, 3)
1805
1805
-
case *ErrorInvalidNetworkAddress:
1806
1806
-
writeInt32(writer, 4)
1807
1807
-
case *ErrorOpenStream:
1808
1808
-
writeInt32(writer, 5)
1809
1809
-
case *ErrorSendMessage:
1810
1810
-
writeInt32(writer, 6)
1811
1811
-
case *ErrorNewConnection:
1812
1812
-
writeInt32(writer, 7)
1813
1813
-
case *ErrorMissingConnection:
1814
1814
-
writeInt32(writer, 8)
1815
1815
-
case *ErrorInvalidPublicKey:
1816
1816
-
writeInt32(writer, 9)
1817
1817
-
default:
1818
1818
-
_ = variantValue
1819
1819
-
panic(fmt.Sprintf("invalid error value `%v` in FfiConverterError.Write", value))
1820
1820
-
}
1821
1821
-
}
1822
1822
-
1823
1823
-
type FfiDestroyerError struct{}
1824
1824
-
1825
1825
-
func (_ FfiDestroyerError) Destroy(value *Error) {
1826
1826
-
switch variantValue := value.err.(type) {
1827
1827
-
case ErrorIrohBind:
1828
1828
-
variantValue.destroy()
1829
1829
-
case ErrorInvalidUrl:
1830
1830
-
variantValue.destroy()
1831
1831
-
case ErrorIrohConnect:
1832
1832
-
variantValue.destroy()
1833
1833
-
case ErrorInvalidNetworkAddress:
1834
1834
-
variantValue.destroy()
1835
1835
-
case ErrorOpenStream:
1836
1836
-
variantValue.destroy()
1837
1837
-
case ErrorSendMessage:
1838
1838
-
variantValue.destroy()
1839
1839
-
case ErrorNewConnection:
1840
1840
-
variantValue.destroy()
1841
1841
-
case ErrorMissingConnection:
1842
1842
-
variantValue.destroy()
1843
1843
-
case ErrorInvalidPublicKey:
1844
1844
-
variantValue.destroy()
1845
1845
-
default:
1846
1846
-
_ = variantValue
1847
1847
-
panic(fmt.Sprintf("invalid error value `%v` in FfiDestroyerError.Destroy", value))
1848
1848
-
}
1849
1849
-
}
1850
1850
-
1851
1851
-
type FfiConverterOptionalString struct{}
1852
1852
-
1853
1853
-
var FfiConverterOptionalStringINSTANCE = FfiConverterOptionalString{}
1854
1854
-
1855
1855
-
func (c FfiConverterOptionalString) Lift(rb RustBufferI) *string {
1856
1856
-
return LiftFromRustBuffer[*string](c, rb)
1857
1857
-
}
1858
1858
-
1859
1859
-
func (_ FfiConverterOptionalString) Read(reader io.Reader) *string {
1860
1860
-
if readInt8(reader) == 0 {
1861
1861
-
return nil
1862
1862
-
}
1863
1863
-
temp := FfiConverterStringINSTANCE.Read(reader)
1864
1864
-
return &temp
1865
1865
-
}
1866
1866
-
1867
1867
-
func (c FfiConverterOptionalString) Lower(value *string) C.RustBuffer {
1868
1868
-
return LowerIntoRustBuffer[*string](c, value)
1869
1869
-
}
1870
1870
-
1871
1871
-
func (_ FfiConverterOptionalString) Write(writer io.Writer, value *string) {
1872
1872
-
if value == nil {
1873
1873
-
writeInt8(writer, 0)
1874
1874
-
} else {
1875
1875
-
writeInt8(writer, 1)
1876
1876
-
FfiConverterStringINSTANCE.Write(writer, *value)
1877
1877
-
}
1878
1878
-
}
1879
1879
-
1880
1880
-
type FfiDestroyerOptionalString struct{}
1881
1881
-
1882
1882
-
func (_ FfiDestroyerOptionalString) Destroy(value *string) {
1883
1883
-
if value != nil {
1884
1884
-
FfiDestroyerString{}.Destroy(*value)
1885
1885
-
}
1886
1886
-
}
1887
1887
-
1888
1888
-
type FfiConverterSequenceString struct{}
1889
1889
-
1890
1890
-
var FfiConverterSequenceStringINSTANCE = FfiConverterSequenceString{}
1891
1891
-
1892
1892
-
func (c FfiConverterSequenceString) Lift(rb RustBufferI) []string {
1893
1893
-
return LiftFromRustBuffer[[]string](c, rb)
1894
1894
-
}
1895
1895
-
1896
1896
-
func (c FfiConverterSequenceString) Read(reader io.Reader) []string {
1897
1897
-
length := readInt32(reader)
1898
1898
-
if length == 0 {
1899
1899
-
return nil
1900
1900
-
}
1901
1901
-
result := make([]string, 0, length)
1902
1902
-
for i := int32(0); i < length; i++ {
1903
1903
-
result = append(result, FfiConverterStringINSTANCE.Read(reader))
1904
1904
-
}
1905
1905
-
return result
1906
1906
-
}
1907
1907
-
1908
1908
-
func (c FfiConverterSequenceString) Lower(value []string) C.RustBuffer {
1909
1909
-
return LowerIntoRustBuffer[[]string](c, value)
1910
1910
-
}
1911
1911
-
1912
1912
-
func (c FfiConverterSequenceString) Write(writer io.Writer, value []string) {
1913
1913
-
if len(value) > math.MaxInt32 {
1914
1914
-
panic("[]string is too large to fit into Int32")
1915
1915
-
}
1916
1916
-
1917
1917
-
writeInt32(writer, int32(len(value)))
1918
1918
-
for _, item := range value {
1919
1919
-
FfiConverterStringINSTANCE.Write(writer, item)
1920
1920
-
}
1921
1921
-
}
1922
1922
-
1923
1923
-
type FfiDestroyerSequenceString struct{}
1924
1924
-
1925
1925
-
func (FfiDestroyerSequenceString) Destroy(sequence []string) {
1926
1926
-
for _, value := range sequence {
1927
1927
-
FfiDestroyerString{}.Destroy(value)
1928
1928
-
}
1929
1929
-
}
1930
1930
-
1931
1931
-
const (
1932
1932
-
uniffiRustFuturePollReady int8 = 0
1933
1933
-
uniffiRustFuturePollMaybeReady int8 = 1
1934
1934
-
)
1935
1935
-
1936
1936
-
type rustFuturePollFunc func(C.uint64_t, C.UniffiRustFutureContinuationCallback, C.uint64_t)
1937
1937
-
type rustFutureCompleteFunc[T any] func(C.uint64_t, *C.RustCallStatus) T
1938
1938
-
type rustFutureFreeFunc func(C.uint64_t)
1939
1939
-
1940
1940
-
//export iroh_streamplace_uniffiFutureContinuationCallback
1941
1941
-
func iroh_streamplace_uniffiFutureContinuationCallback(data C.uint64_t, pollResult C.int8_t) {
1942
1942
-
h := cgo.Handle(uintptr(data))
1943
1943
-
waiter := h.Value().(chan int8)
1944
1944
-
waiter <- int8(pollResult)
1945
1945
-
}
1946
1946
-
1947
1947
-
func uniffiRustCallAsync[E any, T any, F any](
1948
1948
-
errConverter BufReader[*E],
1949
1949
-
completeFunc rustFutureCompleteFunc[F],
1950
1950
-
liftFunc func(F) T,
1951
1951
-
rustFuture C.uint64_t,
1952
1952
-
pollFunc rustFuturePollFunc,
1953
1953
-
freeFunc rustFutureFreeFunc,
1954
1954
-
) (T, *E) {
1955
1955
-
defer freeFunc(rustFuture)
1956
1956
-
1957
1957
-
pollResult := int8(-1)
1958
1958
-
waiter := make(chan int8, 1)
1959
1959
-
1960
1960
-
chanHandle := cgo.NewHandle(waiter)
1961
1961
-
defer chanHandle.Delete()
1962
1962
-
1963
1963
-
for pollResult != uniffiRustFuturePollReady {
1964
1964
-
pollFunc(
1965
1965
-
rustFuture,
1966
1966
-
(C.UniffiRustFutureContinuationCallback)(C.iroh_streamplace_uniffiFutureContinuationCallback),
1967
1967
-
C.uint64_t(chanHandle),
1968
1968
-
)
1969
1969
-
pollResult = <-waiter
1970
1970
-
}
1971
1971
-
1972
1972
-
var goValue T
1973
1973
-
var ffiValue F
1974
1974
-
var err *E
1975
1975
-
1976
1976
-
ffiValue, err = rustCallWithError(errConverter, func(status *C.RustCallStatus) F {
1977
1977
-
return completeFunc(rustFuture, status)
1978
1978
-
})
1979
1979
-
if err != nil {
1980
1980
-
return goValue, err
1981
1981
-
}
1982
1982
-
return liftFunc(ffiValue), nil
1983
1983
-
}
1984
1984
-
1985
1985
-
//export iroh_streamplace_uniffiFreeGorutine
1986
1986
-
func iroh_streamplace_uniffiFreeGorutine(data C.uint64_t) {
1987
1987
-
handle := cgo.Handle(uintptr(data))
1988
1988
-
defer handle.Delete()
1989
1989
-
1990
1990
-
guard := handle.Value().(chan struct{})
1991
1991
-
guard <- struct{}{}
1992
1992
-
}
-974
rust/iroh-streamplace/pkg/iroh_streamplace/generated/iroh_streamplace/iroh_streamplace.h
···
1
1
-
2
2
-
3
3
-
// This file was autogenerated by some hot garbage in the `uniffi` crate.
4
4
-
// Trust me, you don't want to mess with it!
5
5
-
6
6
-
7
7
-
8
8
-
#include <stdbool.h>
9
9
-
#include <stdint.h>
10
10
-
11
11
-
// The following structs are used to implement the lowest level
12
12
-
// of the FFI, and thus useful to multiple uniffied crates.
13
13
-
// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H.
14
14
-
#ifdef UNIFFI_SHARED_H
15
15
-
// We also try to prevent mixing versions of shared uniffi header structs.
16
16
-
// If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V6
17
17
-
#ifndef UNIFFI_SHARED_HEADER_V6
18
18
-
#error Combining helper code from multiple versions of uniffi is not supported
19
19
-
#endif // ndef UNIFFI_SHARED_HEADER_V6
20
20
-
#else
21
21
-
#define UNIFFI_SHARED_H
22
22
-
#define UNIFFI_SHARED_HEADER_V6
23
23
-
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
24
24
-
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V6 in this file. ⚠️
25
25
-
26
26
-
typedef struct RustBuffer {
27
27
-
uint64_t capacity;
28
28
-
uint64_t len;
29
29
-
uint8_t *data;
30
30
-
} RustBuffer;
31
31
-
32
32
-
typedef struct ForeignBytes {
33
33
-
int32_t len;
34
34
-
const uint8_t *data;
35
35
-
} ForeignBytes;
36
36
-
37
37
-
// Error definitions
38
38
-
typedef struct RustCallStatus {
39
39
-
int8_t code;
40
40
-
RustBuffer errorBuf;
41
41
-
} RustCallStatus;
42
42
-
43
43
-
#endif // UNIFFI_SHARED_H
44
44
-
45
45
-
46
46
-
#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK
47
47
-
#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK
48
48
-
typedef void (*UniffiRustFutureContinuationCallback)(uint64_t data, int8_t poll_result);
49
49
-
50
50
-
// Making function static works arround:
51
51
-
// https://github.com/golang/go/issues/11263
52
52
-
static void call_UniffiRustFutureContinuationCallback(
53
53
-
UniffiRustFutureContinuationCallback cb, uint64_t data, int8_t poll_result)
54
54
-
{
55
55
-
return cb(data, poll_result);
56
56
-
}
57
57
-
58
58
-
59
59
-
#endif
60
60
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE
61
61
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE
62
62
-
typedef void (*UniffiForeignFutureFree)(uint64_t handle);
63
63
-
64
64
-
// Making function static works arround:
65
65
-
// https://github.com/golang/go/issues/11263
66
66
-
static void call_UniffiForeignFutureFree(
67
67
-
UniffiForeignFutureFree cb, uint64_t handle)
68
68
-
{
69
69
-
return cb(handle);
70
70
-
}
71
71
-
72
72
-
73
73
-
#endif
74
74
-
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE
75
75
-
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE
76
76
-
typedef void (*UniffiCallbackInterfaceFree)(uint64_t handle);
77
77
-
78
78
-
// Making function static works arround:
79
79
-
// https://github.com/golang/go/issues/11263
80
80
-
static void call_UniffiCallbackInterfaceFree(
81
81
-
UniffiCallbackInterfaceFree cb, uint64_t handle)
82
82
-
{
83
83
-
return cb(handle);
84
84
-
}
85
85
-
86
86
-
87
87
-
#endif
88
88
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE
89
89
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE
90
90
-
typedef struct UniffiForeignFuture {
91
91
-
uint64_t handle;
92
92
-
UniffiForeignFutureFree free;
93
93
-
} UniffiForeignFuture;
94
94
-
95
95
-
#endif
96
96
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8
97
97
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8
98
98
-
typedef struct UniffiForeignFutureStructU8 {
99
99
-
uint8_t returnValue;
100
100
-
RustCallStatus callStatus;
101
101
-
} UniffiForeignFutureStructU8;
102
102
-
103
103
-
#endif
104
104
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8
105
105
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8
106
106
-
typedef void (*UniffiForeignFutureCompleteU8)(uint64_t callback_data, UniffiForeignFutureStructU8 result);
107
107
-
108
108
-
// Making function static works arround:
109
109
-
// https://github.com/golang/go/issues/11263
110
110
-
static void call_UniffiForeignFutureCompleteU8(
111
111
-
UniffiForeignFutureCompleteU8 cb, uint64_t callback_data, UniffiForeignFutureStructU8 result)
112
112
-
{
113
113
-
return cb(callback_data, result);
114
114
-
}
115
115
-
116
116
-
117
117
-
#endif
118
118
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8
119
119
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8
120
120
-
typedef struct UniffiForeignFutureStructI8 {
121
121
-
int8_t returnValue;
122
122
-
RustCallStatus callStatus;
123
123
-
} UniffiForeignFutureStructI8;
124
124
-
125
125
-
#endif
126
126
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8
127
127
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8
128
128
-
typedef void (*UniffiForeignFutureCompleteI8)(uint64_t callback_data, UniffiForeignFutureStructI8 result);
129
129
-
130
130
-
// Making function static works arround:
131
131
-
// https://github.com/golang/go/issues/11263
132
132
-
static void call_UniffiForeignFutureCompleteI8(
133
133
-
UniffiForeignFutureCompleteI8 cb, uint64_t callback_data, UniffiForeignFutureStructI8 result)
134
134
-
{
135
135
-
return cb(callback_data, result);
136
136
-
}
137
137
-
138
138
-
139
139
-
#endif
140
140
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16
141
141
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16
142
142
-
typedef struct UniffiForeignFutureStructU16 {
143
143
-
uint16_t returnValue;
144
144
-
RustCallStatus callStatus;
145
145
-
} UniffiForeignFutureStructU16;
146
146
-
147
147
-
#endif
148
148
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16
149
149
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16
150
150
-
typedef void (*UniffiForeignFutureCompleteU16)(uint64_t callback_data, UniffiForeignFutureStructU16 result);
151
151
-
152
152
-
// Making function static works arround:
153
153
-
// https://github.com/golang/go/issues/11263
154
154
-
static void call_UniffiForeignFutureCompleteU16(
155
155
-
UniffiForeignFutureCompleteU16 cb, uint64_t callback_data, UniffiForeignFutureStructU16 result)
156
156
-
{
157
157
-
return cb(callback_data, result);
158
158
-
}
159
159
-
160
160
-
161
161
-
#endif
162
162
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16
163
163
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16
164
164
-
typedef struct UniffiForeignFutureStructI16 {
165
165
-
int16_t returnValue;
166
166
-
RustCallStatus callStatus;
167
167
-
} UniffiForeignFutureStructI16;
168
168
-
169
169
-
#endif
170
170
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16
171
171
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16
172
172
-
typedef void (*UniffiForeignFutureCompleteI16)(uint64_t callback_data, UniffiForeignFutureStructI16 result);
173
173
-
174
174
-
// Making function static works arround:
175
175
-
// https://github.com/golang/go/issues/11263
176
176
-
static void call_UniffiForeignFutureCompleteI16(
177
177
-
UniffiForeignFutureCompleteI16 cb, uint64_t callback_data, UniffiForeignFutureStructI16 result)
178
178
-
{
179
179
-
return cb(callback_data, result);
180
180
-
}
181
181
-
182
182
-
183
183
-
#endif
184
184
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32
185
185
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32
186
186
-
typedef struct UniffiForeignFutureStructU32 {
187
187
-
uint32_t returnValue;
188
188
-
RustCallStatus callStatus;
189
189
-
} UniffiForeignFutureStructU32;
190
190
-
191
191
-
#endif
192
192
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32
193
193
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32
194
194
-
typedef void (*UniffiForeignFutureCompleteU32)(uint64_t callback_data, UniffiForeignFutureStructU32 result);
195
195
-
196
196
-
// Making function static works arround:
197
197
-
// https://github.com/golang/go/issues/11263
198
198
-
static void call_UniffiForeignFutureCompleteU32(
199
199
-
UniffiForeignFutureCompleteU32 cb, uint64_t callback_data, UniffiForeignFutureStructU32 result)
200
200
-
{
201
201
-
return cb(callback_data, result);
202
202
-
}
203
203
-
204
204
-
205
205
-
#endif
206
206
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32
207
207
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32
208
208
-
typedef struct UniffiForeignFutureStructI32 {
209
209
-
int32_t returnValue;
210
210
-
RustCallStatus callStatus;
211
211
-
} UniffiForeignFutureStructI32;
212
212
-
213
213
-
#endif
214
214
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32
215
215
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32
216
216
-
typedef void (*UniffiForeignFutureCompleteI32)(uint64_t callback_data, UniffiForeignFutureStructI32 result);
217
217
-
218
218
-
// Making function static works arround:
219
219
-
// https://github.com/golang/go/issues/11263
220
220
-
static void call_UniffiForeignFutureCompleteI32(
221
221
-
UniffiForeignFutureCompleteI32 cb, uint64_t callback_data, UniffiForeignFutureStructI32 result)
222
222
-
{
223
223
-
return cb(callback_data, result);
224
224
-
}
225
225
-
226
226
-
227
227
-
#endif
228
228
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64
229
229
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64
230
230
-
typedef struct UniffiForeignFutureStructU64 {
231
231
-
uint64_t returnValue;
232
232
-
RustCallStatus callStatus;
233
233
-
} UniffiForeignFutureStructU64;
234
234
-
235
235
-
#endif
236
236
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64
237
237
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64
238
238
-
typedef void (*UniffiForeignFutureCompleteU64)(uint64_t callback_data, UniffiForeignFutureStructU64 result);
239
239
-
240
240
-
// Making function static works arround:
241
241
-
// https://github.com/golang/go/issues/11263
242
242
-
static void call_UniffiForeignFutureCompleteU64(
243
243
-
UniffiForeignFutureCompleteU64 cb, uint64_t callback_data, UniffiForeignFutureStructU64 result)
244
244
-
{
245
245
-
return cb(callback_data, result);
246
246
-
}
247
247
-
248
248
-
249
249
-
#endif
250
250
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64
251
251
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64
252
252
-
typedef struct UniffiForeignFutureStructI64 {
253
253
-
int64_t returnValue;
254
254
-
RustCallStatus callStatus;
255
255
-
} UniffiForeignFutureStructI64;
256
256
-
257
257
-
#endif
258
258
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64
259
259
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64
260
260
-
typedef void (*UniffiForeignFutureCompleteI64)(uint64_t callback_data, UniffiForeignFutureStructI64 result);
261
261
-
262
262
-
// Making function static works arround:
263
263
-
// https://github.com/golang/go/issues/11263
264
264
-
static void call_UniffiForeignFutureCompleteI64(
265
265
-
UniffiForeignFutureCompleteI64 cb, uint64_t callback_data, UniffiForeignFutureStructI64 result)
266
266
-
{
267
267
-
return cb(callback_data, result);
268
268
-
}
269
269
-
270
270
-
271
271
-
#endif
272
272
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32
273
273
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32
274
274
-
typedef struct UniffiForeignFutureStructF32 {
275
275
-
float returnValue;
276
276
-
RustCallStatus callStatus;
277
277
-
} UniffiForeignFutureStructF32;
278
278
-
279
279
-
#endif
280
280
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32
281
281
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32
282
282
-
typedef void (*UniffiForeignFutureCompleteF32)(uint64_t callback_data, UniffiForeignFutureStructF32 result);
283
283
-
284
284
-
// Making function static works arround:
285
285
-
// https://github.com/golang/go/issues/11263
286
286
-
static void call_UniffiForeignFutureCompleteF32(
287
287
-
UniffiForeignFutureCompleteF32 cb, uint64_t callback_data, UniffiForeignFutureStructF32 result)
288
288
-
{
289
289
-
return cb(callback_data, result);
290
290
-
}
291
291
-
292
292
-
293
293
-
#endif
294
294
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64
295
295
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64
296
296
-
typedef struct UniffiForeignFutureStructF64 {
297
297
-
double returnValue;
298
298
-
RustCallStatus callStatus;
299
299
-
} UniffiForeignFutureStructF64;
300
300
-
301
301
-
#endif
302
302
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64
303
303
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64
304
304
-
typedef void (*UniffiForeignFutureCompleteF64)(uint64_t callback_data, UniffiForeignFutureStructF64 result);
305
305
-
306
306
-
// Making function static works arround:
307
307
-
// https://github.com/golang/go/issues/11263
308
308
-
static void call_UniffiForeignFutureCompleteF64(
309
309
-
UniffiForeignFutureCompleteF64 cb, uint64_t callback_data, UniffiForeignFutureStructF64 result)
310
310
-
{
311
311
-
return cb(callback_data, result);
312
312
-
}
313
313
-
314
314
-
315
315
-
#endif
316
316
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER
317
317
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER
318
318
-
typedef struct UniffiForeignFutureStructPointer {
319
319
-
void* returnValue;
320
320
-
RustCallStatus callStatus;
321
321
-
} UniffiForeignFutureStructPointer;
322
322
-
323
323
-
#endif
324
324
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER
325
325
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER
326
326
-
typedef void (*UniffiForeignFutureCompletePointer)(uint64_t callback_data, UniffiForeignFutureStructPointer result);
327
327
-
328
328
-
// Making function static works arround:
329
329
-
// https://github.com/golang/go/issues/11263
330
330
-
static void call_UniffiForeignFutureCompletePointer(
331
331
-
UniffiForeignFutureCompletePointer cb, uint64_t callback_data, UniffiForeignFutureStructPointer result)
332
332
-
{
333
333
-
return cb(callback_data, result);
334
334
-
}
335
335
-
336
336
-
337
337
-
#endif
338
338
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER
339
339
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER
340
340
-
typedef struct UniffiForeignFutureStructRustBuffer {
341
341
-
RustBuffer returnValue;
342
342
-
RustCallStatus callStatus;
343
343
-
} UniffiForeignFutureStructRustBuffer;
344
344
-
345
345
-
#endif
346
346
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER
347
347
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER
348
348
-
typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t callback_data, UniffiForeignFutureStructRustBuffer result);
349
349
-
350
350
-
// Making function static works arround:
351
351
-
// https://github.com/golang/go/issues/11263
352
352
-
static void call_UniffiForeignFutureCompleteRustBuffer(
353
353
-
UniffiForeignFutureCompleteRustBuffer cb, uint64_t callback_data, UniffiForeignFutureStructRustBuffer result)
354
354
-
{
355
355
-
return cb(callback_data, result);
356
356
-
}
357
357
-
358
358
-
359
359
-
#endif
360
360
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID
361
361
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID
362
362
-
typedef struct UniffiForeignFutureStructVoid {
363
363
-
RustCallStatus callStatus;
364
364
-
} UniffiForeignFutureStructVoid;
365
365
-
366
366
-
#endif
367
367
-
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID
368
368
-
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID
369
369
-
typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t callback_data, UniffiForeignFutureStructVoid result);
370
370
-
371
371
-
// Making function static works arround:
372
372
-
// https://github.com/golang/go/issues/11263
373
373
-
static void call_UniffiForeignFutureCompleteVoid(
374
374
-
UniffiForeignFutureCompleteVoid cb, uint64_t callback_data, UniffiForeignFutureStructVoid result)
375
375
-
{
376
376
-
return cb(callback_data, result);
377
377
-
}
378
378
-
379
379
-
380
380
-
#endif
381
381
-
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_DATA_HANDLER_METHOD0
382
382
-
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_DATA_HANDLER_METHOD0
383
383
-
typedef void (*UniffiCallbackInterfaceDataHandlerMethod0)(uint64_t uniffi_handle, void* peer, RustBuffer data, UniffiForeignFutureCompleteVoid uniffi_future_callback, uint64_t uniffi_callback_data, UniffiForeignFuture* uniffi_out_return);
384
384
-
385
385
-
// Making function static works arround:
386
386
-
// https://github.com/golang/go/issues/11263
387
387
-
static void call_UniffiCallbackInterfaceDataHandlerMethod0(
388
388
-
UniffiCallbackInterfaceDataHandlerMethod0 cb, uint64_t uniffi_handle, void* peer, RustBuffer data, UniffiForeignFutureCompleteVoid uniffi_future_callback, uint64_t uniffi_callback_data, UniffiForeignFuture* uniffi_out_return)
389
389
-
{
390
390
-
return cb(uniffi_handle, peer, data, uniffi_future_callback, uniffi_callback_data, uniffi_out_return);
391
391
-
}
392
392
-
393
393
-
394
394
-
#endif
395
395
-
#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_DATA_HANDLER
396
396
-
#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_DATA_HANDLER
397
397
-
typedef struct UniffiVTableCallbackInterfaceDataHandler {
398
398
-
UniffiCallbackInterfaceDataHandlerMethod0 handleData;
399
399
-
UniffiCallbackInterfaceFree uniffiFree;
400
400
-
} UniffiVTableCallbackInterfaceDataHandler;
401
401
-
402
402
-
#endif
403
403
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_DATAHANDLER
404
404
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_DATAHANDLER
405
405
-
void* uniffi_iroh_streamplace_fn_clone_datahandler(void* ptr, RustCallStatus *out_status
406
406
-
);
407
407
-
#endif
408
408
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_DATAHANDLER
409
409
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_DATAHANDLER
410
410
-
void uniffi_iroh_streamplace_fn_free_datahandler(void* ptr, RustCallStatus *out_status
411
411
-
);
412
412
-
#endif
413
413
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_INIT_CALLBACK_VTABLE_DATAHANDLER
414
414
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_INIT_CALLBACK_VTABLE_DATAHANDLER
415
415
-
void uniffi_iroh_streamplace_fn_init_callback_vtable_datahandler(UniffiVTableCallbackInterfaceDataHandler* vtable
416
416
-
);
417
417
-
#endif
418
418
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_DATAHANDLER_HANDLE_DATA
419
419
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_DATAHANDLER_HANDLE_DATA
420
420
-
uint64_t uniffi_iroh_streamplace_fn_method_datahandler_handle_data(void* ptr, void* peer, RustBuffer data
421
421
-
);
422
422
-
#endif
423
423
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_ENDPOINT
424
424
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_ENDPOINT
425
425
-
void* uniffi_iroh_streamplace_fn_clone_endpoint(void* ptr, RustCallStatus *out_status
426
426
-
);
427
427
-
#endif
428
428
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_ENDPOINT
429
429
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_ENDPOINT
430
430
-
void uniffi_iroh_streamplace_fn_free_endpoint(void* ptr, RustCallStatus *out_status
431
431
-
);
432
432
-
#endif
433
433
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_ENDPOINT_NEW
434
434
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_ENDPOINT_NEW
435
435
-
uint64_t uniffi_iroh_streamplace_fn_constructor_endpoint_new(void
436
436
-
437
437
-
);
438
438
-
#endif
439
439
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_ENDPOINT_NODE_ADDR
440
440
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_ENDPOINT_NODE_ADDR
441
441
-
uint64_t uniffi_iroh_streamplace_fn_method_endpoint_node_addr(void* ptr
442
442
-
);
443
443
-
#endif
444
444
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_NODEADDR
445
445
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_NODEADDR
446
446
-
void* uniffi_iroh_streamplace_fn_clone_nodeaddr(void* ptr, RustCallStatus *out_status
447
447
-
);
448
448
-
#endif
449
449
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_NODEADDR
450
450
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_NODEADDR
451
451
-
void uniffi_iroh_streamplace_fn_free_nodeaddr(void* ptr, RustCallStatus *out_status
452
452
-
);
453
453
-
#endif
454
454
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_NODEADDR_NEW
455
455
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_NODEADDR_NEW
456
456
-
void* uniffi_iroh_streamplace_fn_constructor_nodeaddr_new(void* node_id, RustBuffer derp_url, RustBuffer addresses, RustCallStatus *out_status
457
457
-
);
458
458
-
#endif
459
459
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_DIRECT_ADDRESSES
460
460
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_DIRECT_ADDRESSES
461
461
-
RustBuffer uniffi_iroh_streamplace_fn_method_nodeaddr_direct_addresses(void* ptr, RustCallStatus *out_status
462
462
-
);
463
463
-
#endif
464
464
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_EQUAL
465
465
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_EQUAL
466
466
-
int8_t uniffi_iroh_streamplace_fn_method_nodeaddr_equal(void* ptr, void* other, RustCallStatus *out_status
467
467
-
);
468
468
-
#endif
469
469
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_NODE_ID
470
470
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_NODE_ID
471
471
-
void* uniffi_iroh_streamplace_fn_method_nodeaddr_node_id(void* ptr, RustCallStatus *out_status
472
472
-
);
473
473
-
#endif
474
474
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_RELAY_URL
475
475
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_NODEADDR_RELAY_URL
476
476
-
RustBuffer uniffi_iroh_streamplace_fn_method_nodeaddr_relay_url(void* ptr, RustCallStatus *out_status
477
477
-
);
478
478
-
#endif
479
479
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_PUBLICKEY
480
480
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_PUBLICKEY
481
481
-
void* uniffi_iroh_streamplace_fn_clone_publickey(void* ptr, RustCallStatus *out_status
482
482
-
);
483
483
-
#endif
484
484
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_PUBLICKEY
485
485
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_PUBLICKEY
486
486
-
void uniffi_iroh_streamplace_fn_free_publickey(void* ptr, RustCallStatus *out_status
487
487
-
);
488
488
-
#endif
489
489
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_PUBLICKEY_FROM_BYTES
490
490
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_PUBLICKEY_FROM_BYTES
491
491
-
void* uniffi_iroh_streamplace_fn_constructor_publickey_from_bytes(RustBuffer bytes, RustCallStatus *out_status
492
492
-
);
493
493
-
#endif
494
494
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_PUBLICKEY_FROM_STRING
495
495
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_PUBLICKEY_FROM_STRING
496
496
-
void* uniffi_iroh_streamplace_fn_constructor_publickey_from_string(RustBuffer s, RustCallStatus *out_status
497
497
-
);
498
498
-
#endif
499
499
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_EQUAL
500
500
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_EQUAL
501
501
-
int8_t uniffi_iroh_streamplace_fn_method_publickey_equal(void* ptr, void* other, RustCallStatus *out_status
502
502
-
);
503
503
-
#endif
504
504
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_FMT_SHORT
505
505
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_FMT_SHORT
506
506
-
RustBuffer uniffi_iroh_streamplace_fn_method_publickey_fmt_short(void* ptr, RustCallStatus *out_status
507
507
-
);
508
508
-
#endif
509
509
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_TO_BYTES
510
510
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_TO_BYTES
511
511
-
RustBuffer uniffi_iroh_streamplace_fn_method_publickey_to_bytes(void* ptr, RustCallStatus *out_status
512
512
-
);
513
513
-
#endif
514
514
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_UNIFFI_TRAIT_DISPLAY
515
515
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_PUBLICKEY_UNIFFI_TRAIT_DISPLAY
516
516
-
RustBuffer uniffi_iroh_streamplace_fn_method_publickey_uniffi_trait_display(void* ptr, RustCallStatus *out_status
517
517
-
);
518
518
-
#endif
519
519
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_RECEIVER
520
520
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_RECEIVER
521
521
-
void* uniffi_iroh_streamplace_fn_clone_receiver(void* ptr, RustCallStatus *out_status
522
522
-
);
523
523
-
#endif
524
524
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_RECEIVER
525
525
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_RECEIVER
526
526
-
void uniffi_iroh_streamplace_fn_free_receiver(void* ptr, RustCallStatus *out_status
527
527
-
);
528
528
-
#endif
529
529
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_RECEIVER_NEW
530
530
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_RECEIVER_NEW
531
531
-
uint64_t uniffi_iroh_streamplace_fn_constructor_receiver_new(void* endpoint, void* handler
532
532
-
);
533
533
-
#endif
534
534
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_RECEIVER_NODE_ADDR
535
535
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_RECEIVER_NODE_ADDR
536
536
-
uint64_t uniffi_iroh_streamplace_fn_method_receiver_node_addr(void* ptr
537
537
-
);
538
538
-
#endif
539
539
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_SENDER
540
540
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CLONE_SENDER
541
541
-
void* uniffi_iroh_streamplace_fn_clone_sender(void* ptr, RustCallStatus *out_status
542
542
-
);
543
543
-
#endif
544
544
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_SENDER
545
545
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_FREE_SENDER
546
546
-
void uniffi_iroh_streamplace_fn_free_sender(void* ptr, RustCallStatus *out_status
547
547
-
);
548
548
-
#endif
549
549
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_SENDER_NEW
550
550
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_CONSTRUCTOR_SENDER_NEW
551
551
-
uint64_t uniffi_iroh_streamplace_fn_constructor_sender_new(void* endpoint
552
552
-
);
553
553
-
#endif
554
554
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_SENDER_ADD_PEER
555
555
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_SENDER_ADD_PEER
556
556
-
uint64_t uniffi_iroh_streamplace_fn_method_sender_add_peer(void* ptr, void* addr
557
557
-
);
558
558
-
#endif
559
559
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_SENDER_NODE_ADDR
560
560
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_SENDER_NODE_ADDR
561
561
-
uint64_t uniffi_iroh_streamplace_fn_method_sender_node_addr(void* ptr
562
562
-
);
563
563
-
#endif
564
564
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_SENDER_SEND
565
565
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_FN_METHOD_SENDER_SEND
566
566
-
uint64_t uniffi_iroh_streamplace_fn_method_sender_send(void* ptr, void* node_id, RustBuffer data
567
567
-
);
568
568
-
#endif
569
569
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_ALLOC
570
570
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_ALLOC
571
571
-
RustBuffer ffi_iroh_streamplace_rustbuffer_alloc(uint64_t size, RustCallStatus *out_status
572
572
-
);
573
573
-
#endif
574
574
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_FROM_BYTES
575
575
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_FROM_BYTES
576
576
-
RustBuffer ffi_iroh_streamplace_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *out_status
577
577
-
);
578
578
-
#endif
579
579
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_FREE
580
580
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_FREE
581
581
-
void ffi_iroh_streamplace_rustbuffer_free(RustBuffer buf, RustCallStatus *out_status
582
582
-
);
583
583
-
#endif
584
584
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_RESERVE
585
585
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUSTBUFFER_RESERVE
586
586
-
RustBuffer ffi_iroh_streamplace_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *out_status
587
587
-
);
588
588
-
#endif
589
589
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U8
590
590
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U8
591
591
-
void ffi_iroh_streamplace_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
592
592
-
);
593
593
-
#endif
594
594
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U8
595
595
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U8
596
596
-
void ffi_iroh_streamplace_rust_future_cancel_u8(uint64_t handle
597
597
-
);
598
598
-
#endif
599
599
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U8
600
600
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U8
601
601
-
void ffi_iroh_streamplace_rust_future_free_u8(uint64_t handle
602
602
-
);
603
603
-
#endif
604
604
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U8
605
605
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U8
606
606
-
uint8_t ffi_iroh_streamplace_rust_future_complete_u8(uint64_t handle, RustCallStatus *out_status
607
607
-
);
608
608
-
#endif
609
609
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I8
610
610
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I8
611
611
-
void ffi_iroh_streamplace_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
612
612
-
);
613
613
-
#endif
614
614
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I8
615
615
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I8
616
616
-
void ffi_iroh_streamplace_rust_future_cancel_i8(uint64_t handle
617
617
-
);
618
618
-
#endif
619
619
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I8
620
620
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I8
621
621
-
void ffi_iroh_streamplace_rust_future_free_i8(uint64_t handle
622
622
-
);
623
623
-
#endif
624
624
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I8
625
625
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I8
626
626
-
int8_t ffi_iroh_streamplace_rust_future_complete_i8(uint64_t handle, RustCallStatus *out_status
627
627
-
);
628
628
-
#endif
629
629
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U16
630
630
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U16
631
631
-
void ffi_iroh_streamplace_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
632
632
-
);
633
633
-
#endif
634
634
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U16
635
635
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U16
636
636
-
void ffi_iroh_streamplace_rust_future_cancel_u16(uint64_t handle
637
637
-
);
638
638
-
#endif
639
639
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U16
640
640
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U16
641
641
-
void ffi_iroh_streamplace_rust_future_free_u16(uint64_t handle
642
642
-
);
643
643
-
#endif
644
644
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U16
645
645
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U16
646
646
-
uint16_t ffi_iroh_streamplace_rust_future_complete_u16(uint64_t handle, RustCallStatus *out_status
647
647
-
);
648
648
-
#endif
649
649
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I16
650
650
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I16
651
651
-
void ffi_iroh_streamplace_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
652
652
-
);
653
653
-
#endif
654
654
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I16
655
655
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I16
656
656
-
void ffi_iroh_streamplace_rust_future_cancel_i16(uint64_t handle
657
657
-
);
658
658
-
#endif
659
659
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I16
660
660
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I16
661
661
-
void ffi_iroh_streamplace_rust_future_free_i16(uint64_t handle
662
662
-
);
663
663
-
#endif
664
664
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I16
665
665
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I16
666
666
-
int16_t ffi_iroh_streamplace_rust_future_complete_i16(uint64_t handle, RustCallStatus *out_status
667
667
-
);
668
668
-
#endif
669
669
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U32
670
670
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U32
671
671
-
void ffi_iroh_streamplace_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
672
672
-
);
673
673
-
#endif
674
674
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U32
675
675
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U32
676
676
-
void ffi_iroh_streamplace_rust_future_cancel_u32(uint64_t handle
677
677
-
);
678
678
-
#endif
679
679
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U32
680
680
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U32
681
681
-
void ffi_iroh_streamplace_rust_future_free_u32(uint64_t handle
682
682
-
);
683
683
-
#endif
684
684
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U32
685
685
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U32
686
686
-
uint32_t ffi_iroh_streamplace_rust_future_complete_u32(uint64_t handle, RustCallStatus *out_status
687
687
-
);
688
688
-
#endif
689
689
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I32
690
690
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I32
691
691
-
void ffi_iroh_streamplace_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
692
692
-
);
693
693
-
#endif
694
694
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I32
695
695
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I32
696
696
-
void ffi_iroh_streamplace_rust_future_cancel_i32(uint64_t handle
697
697
-
);
698
698
-
#endif
699
699
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I32
700
700
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I32
701
701
-
void ffi_iroh_streamplace_rust_future_free_i32(uint64_t handle
702
702
-
);
703
703
-
#endif
704
704
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I32
705
705
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I32
706
706
-
int32_t ffi_iroh_streamplace_rust_future_complete_i32(uint64_t handle, RustCallStatus *out_status
707
707
-
);
708
708
-
#endif
709
709
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U64
710
710
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_U64
711
711
-
void ffi_iroh_streamplace_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
712
712
-
);
713
713
-
#endif
714
714
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U64
715
715
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_U64
716
716
-
void ffi_iroh_streamplace_rust_future_cancel_u64(uint64_t handle
717
717
-
);
718
718
-
#endif
719
719
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U64
720
720
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_U64
721
721
-
void ffi_iroh_streamplace_rust_future_free_u64(uint64_t handle
722
722
-
);
723
723
-
#endif
724
724
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U64
725
725
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_U64
726
726
-
uint64_t ffi_iroh_streamplace_rust_future_complete_u64(uint64_t handle, RustCallStatus *out_status
727
727
-
);
728
728
-
#endif
729
729
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I64
730
730
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_I64
731
731
-
void ffi_iroh_streamplace_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
732
732
-
);
733
733
-
#endif
734
734
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I64
735
735
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_I64
736
736
-
void ffi_iroh_streamplace_rust_future_cancel_i64(uint64_t handle
737
737
-
);
738
738
-
#endif
739
739
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I64
740
740
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_I64
741
741
-
void ffi_iroh_streamplace_rust_future_free_i64(uint64_t handle
742
742
-
);
743
743
-
#endif
744
744
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I64
745
745
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_I64
746
746
-
int64_t ffi_iroh_streamplace_rust_future_complete_i64(uint64_t handle, RustCallStatus *out_status
747
747
-
);
748
748
-
#endif
749
749
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_F32
750
750
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_F32
751
751
-
void ffi_iroh_streamplace_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
752
752
-
);
753
753
-
#endif
754
754
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_F32
755
755
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_F32
756
756
-
void ffi_iroh_streamplace_rust_future_cancel_f32(uint64_t handle
757
757
-
);
758
758
-
#endif
759
759
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_F32
760
760
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_F32
761
761
-
void ffi_iroh_streamplace_rust_future_free_f32(uint64_t handle
762
762
-
);
763
763
-
#endif
764
764
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_F32
765
765
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_F32
766
766
-
float ffi_iroh_streamplace_rust_future_complete_f32(uint64_t handle, RustCallStatus *out_status
767
767
-
);
768
768
-
#endif
769
769
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_F64
770
770
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_F64
771
771
-
void ffi_iroh_streamplace_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
772
772
-
);
773
773
-
#endif
774
774
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_F64
775
775
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_F64
776
776
-
void ffi_iroh_streamplace_rust_future_cancel_f64(uint64_t handle
777
777
-
);
778
778
-
#endif
779
779
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_F64
780
780
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_F64
781
781
-
void ffi_iroh_streamplace_rust_future_free_f64(uint64_t handle
782
782
-
);
783
783
-
#endif
784
784
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_F64
785
785
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_F64
786
786
-
double ffi_iroh_streamplace_rust_future_complete_f64(uint64_t handle, RustCallStatus *out_status
787
787
-
);
788
788
-
#endif
789
789
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_POINTER
790
790
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_POINTER
791
791
-
void ffi_iroh_streamplace_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
792
792
-
);
793
793
-
#endif
794
794
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_POINTER
795
795
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_POINTER
796
796
-
void ffi_iroh_streamplace_rust_future_cancel_pointer(uint64_t handle
797
797
-
);
798
798
-
#endif
799
799
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_POINTER
800
800
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_POINTER
801
801
-
void ffi_iroh_streamplace_rust_future_free_pointer(uint64_t handle
802
802
-
);
803
803
-
#endif
804
804
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_POINTER
805
805
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_POINTER
806
806
-
void* ffi_iroh_streamplace_rust_future_complete_pointer(uint64_t handle, RustCallStatus *out_status
807
807
-
);
808
808
-
#endif
809
809
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_RUST_BUFFER
810
810
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_RUST_BUFFER
811
811
-
void ffi_iroh_streamplace_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
812
812
-
);
813
813
-
#endif
814
814
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_RUST_BUFFER
815
815
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_RUST_BUFFER
816
816
-
void ffi_iroh_streamplace_rust_future_cancel_rust_buffer(uint64_t handle
817
817
-
);
818
818
-
#endif
819
819
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_RUST_BUFFER
820
820
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_RUST_BUFFER
821
821
-
void ffi_iroh_streamplace_rust_future_free_rust_buffer(uint64_t handle
822
822
-
);
823
823
-
#endif
824
824
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_RUST_BUFFER
825
825
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_RUST_BUFFER
826
826
-
RustBuffer ffi_iroh_streamplace_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *out_status
827
827
-
);
828
828
-
#endif
829
829
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_VOID
830
830
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_POLL_VOID
831
831
-
void ffi_iroh_streamplace_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback callback, uint64_t callback_data
832
832
-
);
833
833
-
#endif
834
834
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_VOID
835
835
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_CANCEL_VOID
836
836
-
void ffi_iroh_streamplace_rust_future_cancel_void(uint64_t handle
837
837
-
);
838
838
-
#endif
839
839
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_VOID
840
840
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_FREE_VOID
841
841
-
void ffi_iroh_streamplace_rust_future_free_void(uint64_t handle
842
842
-
);
843
843
-
#endif
844
844
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_VOID
845
845
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_RUST_FUTURE_COMPLETE_VOID
846
846
-
void ffi_iroh_streamplace_rust_future_complete_void(uint64_t handle, RustCallStatus *out_status
847
847
-
);
848
848
-
#endif
849
849
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_DATAHANDLER_HANDLE_DATA
850
850
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_DATAHANDLER_HANDLE_DATA
851
851
-
uint16_t uniffi_iroh_streamplace_checksum_method_datahandler_handle_data(void
852
852
-
853
853
-
);
854
854
-
#endif
855
855
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_ENDPOINT_NODE_ADDR
856
856
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_ENDPOINT_NODE_ADDR
857
857
-
uint16_t uniffi_iroh_streamplace_checksum_method_endpoint_node_addr(void
858
858
-
859
859
-
);
860
860
-
#endif
861
861
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_DIRECT_ADDRESSES
862
862
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_DIRECT_ADDRESSES
863
863
-
uint16_t uniffi_iroh_streamplace_checksum_method_nodeaddr_direct_addresses(void
864
864
-
865
865
-
);
866
866
-
#endif
867
867
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_EQUAL
868
868
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_EQUAL
869
869
-
uint16_t uniffi_iroh_streamplace_checksum_method_nodeaddr_equal(void
870
870
-
871
871
-
);
872
872
-
#endif
873
873
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_NODE_ID
874
874
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_NODE_ID
875
875
-
uint16_t uniffi_iroh_streamplace_checksum_method_nodeaddr_node_id(void
876
876
-
877
877
-
);
878
878
-
#endif
879
879
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_RELAY_URL
880
880
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_NODEADDR_RELAY_URL
881
881
-
uint16_t uniffi_iroh_streamplace_checksum_method_nodeaddr_relay_url(void
882
882
-
883
883
-
);
884
884
-
#endif
885
885
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_PUBLICKEY_EQUAL
886
886
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_PUBLICKEY_EQUAL
887
887
-
uint16_t uniffi_iroh_streamplace_checksum_method_publickey_equal(void
888
888
-
889
889
-
);
890
890
-
#endif
891
891
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_PUBLICKEY_FMT_SHORT
892
892
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_PUBLICKEY_FMT_SHORT
893
893
-
uint16_t uniffi_iroh_streamplace_checksum_method_publickey_fmt_short(void
894
894
-
895
895
-
);
896
896
-
#endif
897
897
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_PUBLICKEY_TO_BYTES
898
898
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_PUBLICKEY_TO_BYTES
899
899
-
uint16_t uniffi_iroh_streamplace_checksum_method_publickey_to_bytes(void
900
900
-
901
901
-
);
902
902
-
#endif
903
903
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_RECEIVER_NODE_ADDR
904
904
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_RECEIVER_NODE_ADDR
905
905
-
uint16_t uniffi_iroh_streamplace_checksum_method_receiver_node_addr(void
906
906
-
907
907
-
);
908
908
-
#endif
909
909
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_SENDER_ADD_PEER
910
910
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_SENDER_ADD_PEER
911
911
-
uint16_t uniffi_iroh_streamplace_checksum_method_sender_add_peer(void
912
912
-
913
913
-
);
914
914
-
#endif
915
915
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_SENDER_NODE_ADDR
916
916
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_SENDER_NODE_ADDR
917
917
-
uint16_t uniffi_iroh_streamplace_checksum_method_sender_node_addr(void
918
918
-
919
919
-
);
920
920
-
#endif
921
921
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_SENDER_SEND
922
922
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_METHOD_SENDER_SEND
923
923
-
uint16_t uniffi_iroh_streamplace_checksum_method_sender_send(void
924
924
-
925
925
-
);
926
926
-
#endif
927
927
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_ENDPOINT_NEW
928
928
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_ENDPOINT_NEW
929
929
-
uint16_t uniffi_iroh_streamplace_checksum_constructor_endpoint_new(void
930
930
-
931
931
-
);
932
932
-
#endif
933
933
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_NODEADDR_NEW
934
934
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_NODEADDR_NEW
935
935
-
uint16_t uniffi_iroh_streamplace_checksum_constructor_nodeaddr_new(void
936
936
-
937
937
-
);
938
938
-
#endif
939
939
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_PUBLICKEY_FROM_BYTES
940
940
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_PUBLICKEY_FROM_BYTES
941
941
-
uint16_t uniffi_iroh_streamplace_checksum_constructor_publickey_from_bytes(void
942
942
-
943
943
-
);
944
944
-
#endif
945
945
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_PUBLICKEY_FROM_STRING
946
946
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_PUBLICKEY_FROM_STRING
947
947
-
uint16_t uniffi_iroh_streamplace_checksum_constructor_publickey_from_string(void
948
948
-
949
949
-
);
950
950
-
#endif
951
951
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_RECEIVER_NEW
952
952
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_RECEIVER_NEW
953
953
-
uint16_t uniffi_iroh_streamplace_checksum_constructor_receiver_new(void
954
954
-
955
955
-
);
956
956
-
#endif
957
957
-
#ifndef UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_SENDER_NEW
958
958
-
#define UNIFFI_FFIDEF_UNIFFI_IROH_STREAMPLACE_CHECKSUM_CONSTRUCTOR_SENDER_NEW
959
959
-
uint16_t uniffi_iroh_streamplace_checksum_constructor_sender_new(void
960
960
-
961
961
-
);
962
962
-
#endif
963
963
-
#ifndef UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_UNIFFI_CONTRACT_VERSION
964
964
-
#define UNIFFI_FFIDEF_FFI_IROH_STREAMPLACE_UNIFFI_CONTRACT_VERSION
965
965
-
uint32_t ffi_iroh_streamplace_uniffi_contract_version(void
966
966
-
967
967
-
);
968
968
-
#endif
969
969
-
970
970
-
void iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerMethod0(uint64_t uniffi_handle, void* peer, RustBuffer data, UniffiForeignFutureCompleteVoid uniffi_future_callback, uint64_t uniffi_callback_data, UniffiForeignFuture* uniffi_out_return);
971
971
-
void iroh_streamplace_cgo_dispatchCallbackInterfaceDataHandlerFree(uint64_t handle);
972
972
-
973
973
-
void iroh_streamplace_uniffiFutureContinuationCallback(uint64_t, int8_t);
974
974
-
void iroh_streamplace_uniffiFreeGorutine(uint64_t);