@minip2p/react-native 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/jniLibs/arm64-v8a/libminip2p_ffi.so +0 -0
- package/android/src/main/jniLibs/x86_64/libminip2p_ffi.so +0 -0
- package/build/Minip2pFfi.xcframework/ios-arm64/libminip2p_ffi.a +2 -2
- package/build/Minip2pFfi.xcframework/ios-arm64-simulator/libminip2p_ffi.a +2 -2
- package/cpp/generated/minip2p_ffi.cpp +3 -2
- package/lib/module/adapter.js +32 -10
- package/lib/module/adapter.js.map +1 -1
- package/lib/module/generated/minip2p_ffi.js +11 -8
- package/lib/module/generated/minip2p_ffi.js.map +1 -1
- package/lib/module/generated/minip2p_ffi_core.js +662 -243
- package/lib/module/generated/minip2p_ffi_core.js.map +1 -1
- package/lib/typescript/src/adapter.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts +1 -1
- package/lib/typescript/src/generated/minip2p_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi.d.ts +14 -8
- package/lib/typescript/src/generated/minip2p_ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts +464 -130
- package/lib/typescript/src/generated/minip2p_ffi_core.d.ts.map +1 -1
- package/lib/typescript/src/hook-lifecycle.d.ts +2 -2
- package/lib/typescript/src/hook-lifecycle.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/adapter.ts +45 -7
- package/src/generated/minip2p_ffi-ffi.ts +1 -1
- package/src/generated/minip2p_ffi.ts +18 -11
- package/src/generated/minip2p_ffi_core.ts +864 -378
- package/src/hook-lifecycle.ts +2 -2
|
@@ -71,23 +71,206 @@ const stringConverter = (() => {
|
|
|
71
71
|
})();
|
|
72
72
|
const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
73
73
|
|
|
74
|
+
|
|
75
|
+
// Enum: PathKind
|
|
76
|
+
export enum PathKind_Tags {
|
|
77
|
+
Direct = "Direct",
|
|
78
|
+
Punched = "Punched",
|
|
79
|
+
Relayed = "Relayed"
|
|
80
|
+
}
|
|
74
81
|
/**
|
|
75
|
-
*
|
|
82
|
+
* How an established connection was made; see `minip2p::Path`.
|
|
83
|
+
*/
|
|
84
|
+
export const PathKind = (() => {
|
|
85
|
+
|
|
86
|
+
type Direct__interface = {
|
|
87
|
+
tag: PathKind_Tags.Direct
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* A direct connection we dialed or accepted.
|
|
91
|
+
*/
|
|
92
|
+
class Direct_ extends UniffiEnum implements Direct__interface {
|
|
93
|
+
/**
|
|
94
|
+
* @private
|
|
95
|
+
* This field is private and should not be used, use `tag` instead.
|
|
96
|
+
*/
|
|
97
|
+
readonly [uniffiTypeNameSymbol] = "PathKind";
|
|
98
|
+
readonly tag = PathKind_Tags.Direct;
|
|
99
|
+
constructor() {
|
|
100
|
+
super("PathKind", "Direct");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static new(): Direct_ {
|
|
104
|
+
return new Direct_();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static instanceOf(obj: any): obj is Direct_ {
|
|
108
|
+
return obj.tag === PathKind_Tags.Direct;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type Punched__interface = {
|
|
114
|
+
tag: PathKind_Tags.Punched
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* A direct connection made by a DCUtR hole punch.
|
|
118
|
+
*/
|
|
119
|
+
class Punched_ extends UniffiEnum implements Punched__interface {
|
|
120
|
+
/**
|
|
121
|
+
* @private
|
|
122
|
+
* This field is private and should not be used, use `tag` instead.
|
|
123
|
+
*/
|
|
124
|
+
readonly [uniffiTypeNameSymbol] = "PathKind";
|
|
125
|
+
readonly tag = PathKind_Tags.Punched;
|
|
126
|
+
constructor() {
|
|
127
|
+
super("PathKind", "Punched");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static new(): Punched_ {
|
|
131
|
+
return new Punched_();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
static instanceOf(obj: any): obj is Punched_ {
|
|
135
|
+
return obj.tag === PathKind_Tags.Punched;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type Relayed__interface = {
|
|
141
|
+
tag: PathKind_Tags.Relayed;
|
|
142
|
+
inner:
|
|
143
|
+
Readonly<{relayPeerId: string}>
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Traffic is carried through a relay.
|
|
147
|
+
*/
|
|
148
|
+
class Relayed_ extends UniffiEnum implements Relayed__interface {
|
|
149
|
+
/**
|
|
150
|
+
* @private
|
|
151
|
+
* This field is private and should not be used, use `tag` instead.
|
|
152
|
+
*/
|
|
153
|
+
readonly [uniffiTypeNameSymbol] = "PathKind";
|
|
154
|
+
readonly tag = PathKind_Tags.Relayed;
|
|
155
|
+
readonly inner:
|
|
156
|
+
Readonly<{relayPeerId: string}>;
|
|
157
|
+
constructor(
|
|
158
|
+
inner: {relayPeerId: string }) {
|
|
159
|
+
super("PathKind", "Relayed");
|
|
160
|
+
|
|
161
|
+
this.inner = Object.freeze(inner);
|
|
162
|
+
}
|
|
163
|
+
static new(
|
|
164
|
+
inner: {relayPeerId: string }): Relayed_ {
|
|
165
|
+
return new Relayed_(inner);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
static instanceOf(obj: any): obj is Relayed_ {
|
|
169
|
+
return obj.tag === PathKind_Tags.Relayed;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function instanceOf(obj: any): obj is PathKind {
|
|
175
|
+
return obj[uniffiTypeNameSymbol] === "PathKind";
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return Object.freeze({
|
|
179
|
+
instanceOf,
|
|
180
|
+
Direct: Direct_,
|
|
181
|
+
Punched: Punched_,
|
|
182
|
+
Relayed: Relayed_
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
})();
|
|
186
|
+
/**
|
|
187
|
+
* How an established connection was made; see `minip2p::Path`.
|
|
188
|
+
*/
|
|
189
|
+
export type PathKind = InstanceType<
|
|
190
|
+
typeof PathKind['Direct' | 'Punched' | 'Relayed']
|
|
191
|
+
>;
|
|
192
|
+
|
|
193
|
+
// FfiConverter for enum PathKind
|
|
194
|
+
const FfiConverterTypePathKind = (() => {
|
|
195
|
+
type TypeName = PathKind;
|
|
196
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
197
|
+
readFromCursor(c: Cursor): TypeName {
|
|
198
|
+
switch (c.readI32()) {
|
|
199
|
+
case 1: return new PathKind.Direct();
|
|
200
|
+
case 2: return new PathKind.Punched();
|
|
201
|
+
case 3: return new PathKind.Relayed({relayPeerId: FfiConverterString.readFromCursor(c) });
|
|
202
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
206
|
+
switch (value.tag) {
|
|
207
|
+
case PathKind_Tags.Direct: {
|
|
208
|
+
c.writeI32(1);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
case PathKind_Tags.Punched: {
|
|
212
|
+
c.writeI32(2);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
case PathKind_Tags.Relayed: {
|
|
216
|
+
c.writeI32(3);
|
|
217
|
+
const inner = value.inner;
|
|
218
|
+
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
default:
|
|
222
|
+
// Throwing from here means that PathKind_Tags hasn't matched an ordinal.
|
|
223
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
allocationSize(value: TypeName): number {
|
|
227
|
+
switch (value.tag) {
|
|
228
|
+
case PathKind_Tags.Direct: {
|
|
229
|
+
return 4;
|
|
230
|
+
}
|
|
231
|
+
case PathKind_Tags.Punched: {
|
|
232
|
+
return 4;
|
|
233
|
+
}
|
|
234
|
+
case PathKind_Tags.Relayed: {
|
|
235
|
+
const inner = value.inner;
|
|
236
|
+
let size = 4;
|
|
237
|
+
size += FfiConverterString.allocationSize(inner.relayPeerId);
|
|
238
|
+
return size;
|
|
239
|
+
}
|
|
240
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return new FFIConverter();
|
|
245
|
+
})();
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* State snapshot of a peer's established connection; see
|
|
249
|
+
* `minip2p::ConnectionInfo`.
|
|
76
250
|
*/
|
|
77
251
|
export type ConnectionInfo = {
|
|
252
|
+
/**
|
|
253
|
+
* The peer on the other end.
|
|
254
|
+
*/
|
|
255
|
+
peerId: string,
|
|
78
256
|
/**
|
|
79
257
|
* Endpoint-local transport connection id.
|
|
80
258
|
*/
|
|
81
259
|
connId: bigint,
|
|
82
260
|
/**
|
|
83
|
-
* Remote transport address
|
|
261
|
+
* Remote transport address the transport reported; a circuit reports
|
|
262
|
+
* `/p2p/<relay>/p2p-circuit`.
|
|
263
|
+
*/
|
|
264
|
+
remoteAddr: string,
|
|
265
|
+
/**
|
|
266
|
+
* How the connection was made.
|
|
84
267
|
*/
|
|
85
|
-
|
|
268
|
+
path: PathKind,
|
|
86
269
|
/**
|
|
87
270
|
* Protocols this connection advertised through Identify, once it is
|
|
88
|
-
* ready (`PeerReady` for this `conn_id`); `None` until then
|
|
89
|
-
* connection and protocols come from one
|
|
90
|
-
* trust them together.
|
|
271
|
+
* ready (`PeerReady` for this `conn_id`); `None` until then, distinct
|
|
272
|
+
* from an empty list. Readiness, connection and protocols come from one
|
|
273
|
+
* snapshot, so a ready wait can trust them together.
|
|
91
274
|
*/
|
|
92
275
|
readyProtocols?: Array<string>
|
|
93
276
|
}
|
|
@@ -113,19 +296,25 @@ const FfiConverterTypeConnectionInfo = (() => {
|
|
|
113
296
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
114
297
|
readFromCursor(c: Cursor): TypeName {
|
|
115
298
|
return {
|
|
299
|
+
peerId: FfiConverterString.readFromCursor(c),
|
|
116
300
|
connId: FfiConverterUInt64.readFromCursor(c),
|
|
117
|
-
remoteAddr:
|
|
301
|
+
remoteAddr: FfiConverterString.readFromCursor(c),
|
|
302
|
+
path: FfiConverterTypePathKind.readFromCursor(c),
|
|
118
303
|
readyProtocols: FfiConverterOptionalSequenceString.readFromCursor(c)
|
|
119
304
|
};
|
|
120
305
|
}
|
|
121
306
|
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
307
|
+
FfiConverterString.writeIntoCursor(value.peerId, c);
|
|
122
308
|
FfiConverterUInt64.writeIntoCursor(value.connId, c);
|
|
123
|
-
|
|
309
|
+
FfiConverterString.writeIntoCursor(value.remoteAddr, c);
|
|
310
|
+
FfiConverterTypePathKind.writeIntoCursor(value.path, c);
|
|
124
311
|
FfiConverterOptionalSequenceString.writeIntoCursor(value.readyProtocols, c);
|
|
125
312
|
}
|
|
126
313
|
allocationSize(value: TypeName): number {
|
|
127
|
-
return
|
|
128
|
-
|
|
314
|
+
return FfiConverterString.allocationSize(value.peerId) +
|
|
315
|
+
FfiConverterUInt64.allocationSize(value.connId) +
|
|
316
|
+
FfiConverterString.allocationSize(value.remoteAddr) +
|
|
317
|
+
FfiConverterTypePathKind.allocationSize(value.path) +
|
|
129
318
|
FfiConverterOptionalSequenceString.allocationSize(value.readyProtocols);
|
|
130
319
|
|
|
131
320
|
}
|
|
@@ -662,6 +851,103 @@ const FfiConverterTypeRelayReservationInfo = (() => {
|
|
|
662
851
|
return new FFIConverter();
|
|
663
852
|
})();
|
|
664
853
|
|
|
854
|
+
/**
|
|
855
|
+
* A connection still tracked when the closing drain ended.
|
|
856
|
+
*/
|
|
857
|
+
export type UnfinishedConnection = {
|
|
858
|
+
/**
|
|
859
|
+
* Endpoint-local transport connection id.
|
|
860
|
+
*/
|
|
861
|
+
connId: bigint,
|
|
862
|
+
/**
|
|
863
|
+
* Remote peer; `None` for an inbound handshake that had not identified
|
|
864
|
+
* one yet.
|
|
865
|
+
*/
|
|
866
|
+
peerId?: string
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Generated factory for {@link UnfinishedConnection} record objects.
|
|
871
|
+
*/
|
|
872
|
+
export const UnfinishedConnection = (() => {
|
|
873
|
+
const defaults = () => ({
|
|
874
|
+
});
|
|
875
|
+
const create = (() => {
|
|
876
|
+
return uniffiCreateRecord<UnfinishedConnection, ReturnType<typeof defaults>>(defaults);
|
|
877
|
+
})();
|
|
878
|
+
return Object.freeze({
|
|
879
|
+
create,
|
|
880
|
+
new: create,
|
|
881
|
+
defaults: () => Object.freeze(defaults()) as Partial<UnfinishedConnection>,
|
|
882
|
+
});
|
|
883
|
+
})();
|
|
884
|
+
|
|
885
|
+
const FfiConverterTypeUnfinishedConnection = (() => {
|
|
886
|
+
type TypeName = UnfinishedConnection;
|
|
887
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
888
|
+
readFromCursor(c: Cursor): TypeName {
|
|
889
|
+
return {
|
|
890
|
+
connId: FfiConverterUInt64.readFromCursor(c),
|
|
891
|
+
peerId: FfiConverterOptionalString.readFromCursor(c)
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
895
|
+
FfiConverterUInt64.writeIntoCursor(value.connId, c);
|
|
896
|
+
FfiConverterOptionalString.writeIntoCursor(value.peerId, c);
|
|
897
|
+
}
|
|
898
|
+
allocationSize(value: TypeName): number {
|
|
899
|
+
return FfiConverterUInt64.allocationSize(value.connId) +
|
|
900
|
+
FfiConverterOptionalString.allocationSize(value.peerId);
|
|
901
|
+
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
return new FFIConverter();
|
|
905
|
+
})();
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* How the driver's closing drain ended; see [`P2pEvent::EndpointClosed`].
|
|
909
|
+
*/
|
|
910
|
+
export enum CloseOutcome {
|
|
911
|
+
/**
|
|
912
|
+
* Every tracked connection finished its teardown in time.
|
|
913
|
+
*/
|
|
914
|
+
Drained,
|
|
915
|
+
/**
|
|
916
|
+
* The stop deadline passed with connections still tracked.
|
|
917
|
+
*/
|
|
918
|
+
DeadlineExpired,
|
|
919
|
+
/**
|
|
920
|
+
* Driving the transports failed and ended the drain early, or the
|
|
921
|
+
* driver panicked and dropped the endpoint without a drain.
|
|
922
|
+
*/
|
|
923
|
+
Failed
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
const FfiConverterTypeCloseOutcome = (() => {
|
|
927
|
+
type TypeName = CloseOutcome;
|
|
928
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
929
|
+
readFromCursor(c: Cursor): TypeName {
|
|
930
|
+
switch (c.readI32()) {
|
|
931
|
+
case 1: return CloseOutcome.Drained;
|
|
932
|
+
case 2: return CloseOutcome.DeadlineExpired;
|
|
933
|
+
case 3: return CloseOutcome.Failed;
|
|
934
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
938
|
+
switch (value) {
|
|
939
|
+
case CloseOutcome.Drained: return c.writeI32(1);
|
|
940
|
+
case CloseOutcome.DeadlineExpired: return c.writeI32(2);
|
|
941
|
+
case CloseOutcome.Failed: return c.writeI32(3);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
allocationSize(value: TypeName): number {
|
|
945
|
+
return 4;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return new FFIConverter();
|
|
949
|
+
})();
|
|
950
|
+
|
|
665
951
|
/**
|
|
666
952
|
* The part of an endpoint's configuration an [`FfiError::InvalidConfig`]
|
|
667
953
|
* names.
|
|
@@ -737,139 +1023,399 @@ export enum ConnectTarget_Tags {
|
|
|
737
1023
|
*/
|
|
738
1024
|
export const ConnectTarget = (() => {
|
|
739
1025
|
|
|
740
|
-
type Peer__interface = {
|
|
741
|
-
tag: ConnectTarget_Tags.Peer;
|
|
1026
|
+
type Peer__interface = {
|
|
1027
|
+
tag: ConnectTarget_Tags.Peer;
|
|
1028
|
+
inner:
|
|
1029
|
+
Readonly<{peerId: string}>
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Peer ID only: the endpoint applies its discovery-book and relay
|
|
1033
|
+
* policy.
|
|
1034
|
+
*/
|
|
1035
|
+
class Peer_ extends UniffiEnum implements Peer__interface {
|
|
1036
|
+
/**
|
|
1037
|
+
* @private
|
|
1038
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1039
|
+
*/
|
|
1040
|
+
readonly [uniffiTypeNameSymbol] = "ConnectTarget";
|
|
1041
|
+
readonly tag = ConnectTarget_Tags.Peer;
|
|
1042
|
+
readonly inner:
|
|
1043
|
+
Readonly<{peerId: string}>;
|
|
1044
|
+
constructor(
|
|
1045
|
+
inner: {peerId: string }) {
|
|
1046
|
+
super("ConnectTarget", "Peer");
|
|
1047
|
+
|
|
1048
|
+
this.inner = Object.freeze(inner);
|
|
1049
|
+
}
|
|
1050
|
+
static new(
|
|
1051
|
+
inner: {peerId: string }): Peer_ {
|
|
1052
|
+
return new Peer_(inner);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
static instanceOf(obj: any): obj is Peer_ {
|
|
1056
|
+
return obj.tag === ConnectTarget_Tags.Peer;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
type Addresses__interface = {
|
|
1062
|
+
tag: ConnectTarget_Tags.Addresses;
|
|
1063
|
+
inner:
|
|
1064
|
+
Readonly<{addresses: Array<string>}>
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* One or more complete direct peer addresses that all name the same
|
|
1068
|
+
* peer. One address is the single-address form.
|
|
1069
|
+
*/
|
|
1070
|
+
class Addresses_ extends UniffiEnum implements Addresses__interface {
|
|
1071
|
+
/**
|
|
1072
|
+
* @private
|
|
1073
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1074
|
+
*/
|
|
1075
|
+
readonly [uniffiTypeNameSymbol] = "ConnectTarget";
|
|
1076
|
+
readonly tag = ConnectTarget_Tags.Addresses;
|
|
1077
|
+
readonly inner:
|
|
1078
|
+
Readonly<{addresses: Array<string>}>;
|
|
1079
|
+
constructor(
|
|
1080
|
+
inner: {addresses: Array<string> }) {
|
|
1081
|
+
super("ConnectTarget", "Addresses");
|
|
1082
|
+
|
|
1083
|
+
this.inner = Object.freeze(inner);
|
|
1084
|
+
}
|
|
1085
|
+
static new(
|
|
1086
|
+
inner: {addresses: Array<string> }): Addresses_ {
|
|
1087
|
+
return new Addresses_(inner);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
static instanceOf(obj: any): obj is Addresses_ {
|
|
1091
|
+
return obj.tag === ConnectTarget_Tags.Addresses;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
function instanceOf(obj: any): obj is ConnectTarget {
|
|
1097
|
+
return obj[uniffiTypeNameSymbol] === "ConnectTarget";
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
return Object.freeze({
|
|
1101
|
+
instanceOf,
|
|
1102
|
+
Peer: Peer_,
|
|
1103
|
+
Addresses: Addresses_
|
|
1104
|
+
});
|
|
1105
|
+
|
|
1106
|
+
})();
|
|
1107
|
+
/**
|
|
1108
|
+
* What a foreign runtime supplies to start one Connection attempt.
|
|
1109
|
+
*
|
|
1110
|
+
* Validation for every form lives in this module, once; binding shells only
|
|
1111
|
+
* adapt the shape to their toolchain.
|
|
1112
|
+
*/
|
|
1113
|
+
export type ConnectTarget = InstanceType<
|
|
1114
|
+
typeof ConnectTarget['Peer' | 'Addresses']
|
|
1115
|
+
>;
|
|
1116
|
+
|
|
1117
|
+
// FfiConverter for enum ConnectTarget
|
|
1118
|
+
const FfiConverterTypeConnectTarget = (() => {
|
|
1119
|
+
type TypeName = ConnectTarget;
|
|
1120
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1121
|
+
readFromCursor(c: Cursor): TypeName {
|
|
1122
|
+
switch (c.readI32()) {
|
|
1123
|
+
case 1: return new ConnectTarget.Peer({peerId: FfiConverterString.readFromCursor(c) });
|
|
1124
|
+
case 2: return new ConnectTarget.Addresses({addresses: FfiConverterSequenceString.readFromCursor(c) });
|
|
1125
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
1129
|
+
switch (value.tag) {
|
|
1130
|
+
case ConnectTarget_Tags.Peer: {
|
|
1131
|
+
c.writeI32(1);
|
|
1132
|
+
const inner = value.inner;
|
|
1133
|
+
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
case ConnectTarget_Tags.Addresses: {
|
|
1137
|
+
c.writeI32(2);
|
|
1138
|
+
const inner = value.inner;
|
|
1139
|
+
FfiConverterSequenceString.writeIntoCursor(inner.addresses, c);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
default:
|
|
1143
|
+
// Throwing from here means that ConnectTarget_Tags hasn't matched an ordinal.
|
|
1144
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
allocationSize(value: TypeName): number {
|
|
1148
|
+
switch (value.tag) {
|
|
1149
|
+
case ConnectTarget_Tags.Peer: {
|
|
1150
|
+
const inner = value.inner;
|
|
1151
|
+
let size = 4;
|
|
1152
|
+
size += FfiConverterString.allocationSize(inner.peerId);
|
|
1153
|
+
return size;
|
|
1154
|
+
}
|
|
1155
|
+
case ConnectTarget_Tags.Addresses: {
|
|
1156
|
+
const inner = value.inner;
|
|
1157
|
+
let size = 4;
|
|
1158
|
+
size += FfiConverterSequenceString.allocationSize(inner.addresses);
|
|
1159
|
+
return size;
|
|
1160
|
+
}
|
|
1161
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
return new FFIConverter();
|
|
1166
|
+
})();
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
// Enum: ConnectionCloseReason
|
|
1170
|
+
export enum ConnectionCloseReason_Tags {
|
|
1171
|
+
Local = "Local",
|
|
1172
|
+
Remote = "Remote",
|
|
1173
|
+
TimedOut = "TimedOut",
|
|
1174
|
+
Stalled = "Stalled",
|
|
1175
|
+
Error = "Error"
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
1179
|
+
*/
|
|
1180
|
+
export const ConnectionCloseReason = (() => {
|
|
1181
|
+
|
|
1182
|
+
type Local__interface = {
|
|
1183
|
+
tag: ConnectionCloseReason_Tags.Local
|
|
1184
|
+
};
|
|
1185
|
+
/**
|
|
1186
|
+
* We closed it.
|
|
1187
|
+
*/
|
|
1188
|
+
class Local_ extends UniffiEnum implements Local__interface {
|
|
1189
|
+
/**
|
|
1190
|
+
* @private
|
|
1191
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1192
|
+
*/
|
|
1193
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1194
|
+
readonly tag = ConnectionCloseReason_Tags.Local;
|
|
1195
|
+
constructor() {
|
|
1196
|
+
super("ConnectionCloseReason", "Local");
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
static new(): Local_ {
|
|
1200
|
+
return new Local_();
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
static instanceOf(obj: any): obj is Local_ {
|
|
1204
|
+
return obj.tag === ConnectionCloseReason_Tags.Local;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
type Remote__interface = {
|
|
1210
|
+
tag: ConnectionCloseReason_Tags.Remote;
|
|
742
1211
|
inner:
|
|
743
|
-
Readonly<{
|
|
1212
|
+
Readonly<{code: bigint}>
|
|
744
1213
|
};
|
|
745
1214
|
/**
|
|
746
|
-
*
|
|
747
|
-
*
|
|
1215
|
+
* The peer closed it with `code`: its QUIC CONNECTION_CLOSE code, or
|
|
1216
|
+
* its Yamux `GoAway` code on TCP and relay circuits.
|
|
748
1217
|
*/
|
|
749
|
-
class
|
|
1218
|
+
class Remote_ extends UniffiEnum implements Remote__interface {
|
|
750
1219
|
/**
|
|
751
1220
|
* @private
|
|
752
1221
|
* This field is private and should not be used, use `tag` instead.
|
|
753
1222
|
*/
|
|
754
|
-
readonly [uniffiTypeNameSymbol] = "
|
|
755
|
-
readonly tag =
|
|
1223
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1224
|
+
readonly tag = ConnectionCloseReason_Tags.Remote;
|
|
756
1225
|
readonly inner:
|
|
757
|
-
Readonly<{
|
|
1226
|
+
Readonly<{code: bigint}>;
|
|
758
1227
|
constructor(
|
|
759
|
-
inner: {
|
|
760
|
-
super("
|
|
1228
|
+
inner: {code: bigint }) {
|
|
1229
|
+
super("ConnectionCloseReason", "Remote");
|
|
761
1230
|
|
|
762
1231
|
this.inner = Object.freeze(inner);
|
|
763
1232
|
}
|
|
764
1233
|
static new(
|
|
765
|
-
inner: {
|
|
766
|
-
return new
|
|
1234
|
+
inner: {code: bigint }): Remote_ {
|
|
1235
|
+
return new Remote_(inner);
|
|
767
1236
|
}
|
|
768
1237
|
|
|
769
|
-
static instanceOf(obj: any): obj is
|
|
770
|
-
return obj.tag ===
|
|
1238
|
+
static instanceOf(obj: any): obj is Remote_ {
|
|
1239
|
+
return obj.tag === ConnectionCloseReason_Tags.Remote;
|
|
771
1240
|
}
|
|
772
1241
|
|
|
773
1242
|
}
|
|
774
1243
|
|
|
775
|
-
type
|
|
776
|
-
tag:
|
|
1244
|
+
type TimedOut__interface = {
|
|
1245
|
+
tag: ConnectionCloseReason_Tags.TimedOut
|
|
1246
|
+
};
|
|
1247
|
+
/**
|
|
1248
|
+
* The peer went silent (an idle, keepalive or handshake timeout).
|
|
1249
|
+
*/
|
|
1250
|
+
class TimedOut_ extends UniffiEnum implements TimedOut__interface {
|
|
1251
|
+
/**
|
|
1252
|
+
* @private
|
|
1253
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1254
|
+
*/
|
|
1255
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1256
|
+
readonly tag = ConnectionCloseReason_Tags.TimedOut;
|
|
1257
|
+
constructor() {
|
|
1258
|
+
super("ConnectionCloseReason", "TimedOut");
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
static new(): TimedOut_ {
|
|
1262
|
+
return new TimedOut_();
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
static instanceOf(obj: any): obj is TimedOut_ {
|
|
1266
|
+
return obj.tag === ConnectionCloseReason_Tags.TimedOut;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
type Stalled__interface = {
|
|
1272
|
+
tag: ConnectionCloseReason_Tags.Stalled
|
|
1273
|
+
};
|
|
1274
|
+
/**
|
|
1275
|
+
* The peer stopped reading (a TCP send stall).
|
|
1276
|
+
*/
|
|
1277
|
+
class Stalled_ extends UniffiEnum implements Stalled__interface {
|
|
1278
|
+
/**
|
|
1279
|
+
* @private
|
|
1280
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1281
|
+
*/
|
|
1282
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1283
|
+
readonly tag = ConnectionCloseReason_Tags.Stalled;
|
|
1284
|
+
constructor() {
|
|
1285
|
+
super("ConnectionCloseReason", "Stalled");
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
static new(): Stalled_ {
|
|
1289
|
+
return new Stalled_();
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
static instanceOf(obj: any): obj is Stalled_ {
|
|
1293
|
+
return obj.tag === ConnectionCloseReason_Tags.Stalled;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
type Error__interface = {
|
|
1299
|
+
tag: ConnectionCloseReason_Tags.Error;
|
|
777
1300
|
inner:
|
|
778
|
-
Readonly<{
|
|
1301
|
+
Readonly<{message: string}>
|
|
779
1302
|
};
|
|
780
1303
|
/**
|
|
781
|
-
*
|
|
782
|
-
* peer. One address is the single-address form.
|
|
1304
|
+
* Anything else that ended it.
|
|
783
1305
|
*/
|
|
784
|
-
class
|
|
1306
|
+
class Error_ extends UniffiEnum implements Error__interface {
|
|
785
1307
|
/**
|
|
786
1308
|
* @private
|
|
787
1309
|
* This field is private and should not be used, use `tag` instead.
|
|
788
1310
|
*/
|
|
789
|
-
readonly [uniffiTypeNameSymbol] = "
|
|
790
|
-
readonly tag =
|
|
1311
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1312
|
+
readonly tag = ConnectionCloseReason_Tags.Error;
|
|
791
1313
|
readonly inner:
|
|
792
|
-
Readonly<{
|
|
1314
|
+
Readonly<{message: string}>;
|
|
793
1315
|
constructor(
|
|
794
|
-
inner: {
|
|
795
|
-
super("
|
|
1316
|
+
inner: {message: string }) {
|
|
1317
|
+
super("ConnectionCloseReason", "Error");
|
|
796
1318
|
|
|
797
1319
|
this.inner = Object.freeze(inner);
|
|
798
1320
|
}
|
|
799
1321
|
static new(
|
|
800
|
-
inner: {
|
|
801
|
-
return new
|
|
1322
|
+
inner: {message: string }): Error_ {
|
|
1323
|
+
return new Error_(inner);
|
|
802
1324
|
}
|
|
803
1325
|
|
|
804
|
-
static instanceOf(obj: any): obj is
|
|
805
|
-
return obj.tag ===
|
|
1326
|
+
static instanceOf(obj: any): obj is Error_ {
|
|
1327
|
+
return obj.tag === ConnectionCloseReason_Tags.Error;
|
|
806
1328
|
}
|
|
807
1329
|
|
|
808
1330
|
}
|
|
809
1331
|
|
|
810
|
-
function instanceOf(obj: any): obj is
|
|
811
|
-
return obj[uniffiTypeNameSymbol] === "
|
|
1332
|
+
function instanceOf(obj: any): obj is ConnectionCloseReason {
|
|
1333
|
+
return obj[uniffiTypeNameSymbol] === "ConnectionCloseReason";
|
|
812
1334
|
}
|
|
813
1335
|
|
|
814
1336
|
return Object.freeze({
|
|
815
1337
|
instanceOf,
|
|
816
|
-
|
|
817
|
-
|
|
1338
|
+
Local: Local_,
|
|
1339
|
+
Remote: Remote_,
|
|
1340
|
+
TimedOut: TimedOut_,
|
|
1341
|
+
Stalled: Stalled_,
|
|
1342
|
+
Error: Error_
|
|
818
1343
|
});
|
|
819
1344
|
|
|
820
1345
|
})();
|
|
821
1346
|
/**
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
* Validation for every form lives in this module, once; binding shells only
|
|
825
|
-
* adapt the shape to their toolchain.
|
|
1347
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
826
1348
|
*/
|
|
827
|
-
export type
|
|
828
|
-
typeof
|
|
1349
|
+
export type ConnectionCloseReason = InstanceType<
|
|
1350
|
+
typeof ConnectionCloseReason['Local' | 'Remote' | 'TimedOut' | 'Stalled' | 'Error']
|
|
829
1351
|
>;
|
|
830
1352
|
|
|
831
|
-
// FfiConverter for enum
|
|
832
|
-
const
|
|
833
|
-
type TypeName =
|
|
1353
|
+
// FfiConverter for enum ConnectionCloseReason
|
|
1354
|
+
const FfiConverterTypeConnectionCloseReason = (() => {
|
|
1355
|
+
type TypeName = ConnectionCloseReason;
|
|
834
1356
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
835
1357
|
readFromCursor(c: Cursor): TypeName {
|
|
836
1358
|
switch (c.readI32()) {
|
|
837
|
-
case 1: return new
|
|
838
|
-
case 2: return new
|
|
1359
|
+
case 1: return new ConnectionCloseReason.Local();
|
|
1360
|
+
case 2: return new ConnectionCloseReason.Remote({code: FfiConverterUInt64.readFromCursor(c) });
|
|
1361
|
+
case 3: return new ConnectionCloseReason.TimedOut();
|
|
1362
|
+
case 4: return new ConnectionCloseReason.Stalled();
|
|
1363
|
+
case 5: return new ConnectionCloseReason.Error({message: FfiConverterString.readFromCursor(c) });
|
|
839
1364
|
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
840
1365
|
}
|
|
841
1366
|
}
|
|
842
1367
|
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
843
1368
|
switch (value.tag) {
|
|
844
|
-
case
|
|
1369
|
+
case ConnectionCloseReason_Tags.Local: {
|
|
845
1370
|
c.writeI32(1);
|
|
846
|
-
const inner = value.inner;
|
|
847
|
-
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
848
1371
|
return;
|
|
849
1372
|
}
|
|
850
|
-
case
|
|
1373
|
+
case ConnectionCloseReason_Tags.Remote: {
|
|
851
1374
|
c.writeI32(2);
|
|
852
1375
|
const inner = value.inner;
|
|
853
|
-
|
|
1376
|
+
FfiConverterUInt64.writeIntoCursor(inner.code, c);
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
case ConnectionCloseReason_Tags.TimedOut: {
|
|
1380
|
+
c.writeI32(3);
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1383
|
+
case ConnectionCloseReason_Tags.Stalled: {
|
|
1384
|
+
c.writeI32(4);
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
case ConnectionCloseReason_Tags.Error: {
|
|
1388
|
+
c.writeI32(5);
|
|
1389
|
+
const inner = value.inner;
|
|
1390
|
+
FfiConverterString.writeIntoCursor(inner.message, c);
|
|
854
1391
|
return;
|
|
855
1392
|
}
|
|
856
1393
|
default:
|
|
857
|
-
// Throwing from here means that
|
|
1394
|
+
// Throwing from here means that ConnectionCloseReason_Tags hasn't matched an ordinal.
|
|
858
1395
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
859
1396
|
}
|
|
860
1397
|
}
|
|
861
1398
|
allocationSize(value: TypeName): number {
|
|
862
1399
|
switch (value.tag) {
|
|
863
|
-
case
|
|
1400
|
+
case ConnectionCloseReason_Tags.Local: {
|
|
1401
|
+
return 4;
|
|
1402
|
+
}
|
|
1403
|
+
case ConnectionCloseReason_Tags.Remote: {
|
|
864
1404
|
const inner = value.inner;
|
|
865
1405
|
let size = 4;
|
|
866
|
-
size +=
|
|
1406
|
+
size += FfiConverterUInt64.allocationSize(inner.code);
|
|
867
1407
|
return size;
|
|
868
1408
|
}
|
|
869
|
-
case
|
|
1409
|
+
case ConnectionCloseReason_Tags.TimedOut: {
|
|
1410
|
+
return 4;
|
|
1411
|
+
}
|
|
1412
|
+
case ConnectionCloseReason_Tags.Stalled: {
|
|
1413
|
+
return 4;
|
|
1414
|
+
}
|
|
1415
|
+
case ConnectionCloseReason_Tags.Error: {
|
|
870
1416
|
const inner = value.inner;
|
|
871
1417
|
let size = 4;
|
|
872
|
-
size +=
|
|
1418
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
873
1419
|
return size;
|
|
874
1420
|
}
|
|
875
1421
|
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
@@ -1849,256 +2395,83 @@ export enum NatErrorKind {
|
|
|
1849
2395
|
* A transport dial failed.
|
|
1850
2396
|
*/
|
|
1851
2397
|
DialFailed,
|
|
1852
|
-
/**
|
|
1853
|
-
* A traversal protocol exchange failed.
|
|
1854
|
-
*/
|
|
1855
|
-
Protocol,
|
|
1856
|
-
/**
|
|
1857
|
-
* A relay refused the circuit.
|
|
1858
|
-
*/
|
|
1859
|
-
RelayRefused
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
const FfiConverterTypeNatErrorKind = (() => {
|
|
1863
|
-
type TypeName = NatErrorKind;
|
|
1864
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1865
|
-
readFromCursor(c: Cursor): TypeName {
|
|
1866
|
-
switch (c.readI32()) {
|
|
1867
|
-
case 1: return NatErrorKind.NoPathAvailable;
|
|
1868
|
-
case 2: return NatErrorKind.Timeout;
|
|
1869
|
-
case 3: return NatErrorKind.DialFailed;
|
|
1870
|
-
case 4: return NatErrorKind.Protocol;
|
|
1871
|
-
case 5: return NatErrorKind.RelayRefused;
|
|
1872
|
-
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
|
-
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
1876
|
-
switch (value) {
|
|
1877
|
-
case NatErrorKind.NoPathAvailable: return c.writeI32(1);
|
|
1878
|
-
case NatErrorKind.Timeout: return c.writeI32(2);
|
|
1879
|
-
case NatErrorKind.DialFailed: return c.writeI32(3);
|
|
1880
|
-
case NatErrorKind.Protocol: return c.writeI32(4);
|
|
1881
|
-
case NatErrorKind.RelayRefused: return c.writeI32(5);
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
allocationSize(value: TypeName): number {
|
|
1885
|
-
return 4;
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
return new FFIConverter();
|
|
1889
|
-
})();
|
|
1890
|
-
|
|
1891
|
-
/**
|
|
1892
|
-
* Coarse local reachability state.
|
|
1893
|
-
*/
|
|
1894
|
-
export enum Reachability {
|
|
1895
|
-
/**
|
|
1896
|
-
* Not enough evidence is available.
|
|
1897
|
-
*/
|
|
1898
|
-
Unknown,
|
|
1899
|
-
/**
|
|
1900
|
-
* The endpoint is directly reachable.
|
|
1901
|
-
*/
|
|
1902
|
-
Public,
|
|
1903
|
-
/**
|
|
1904
|
-
* The endpoint needs traversal or relay assistance.
|
|
1905
|
-
*/
|
|
1906
|
-
Private
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
const FfiConverterTypeReachability = (() => {
|
|
1910
|
-
type TypeName = Reachability;
|
|
1911
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1912
|
-
readFromCursor(c: Cursor): TypeName {
|
|
1913
|
-
switch (c.readI32()) {
|
|
1914
|
-
case 1: return Reachability.Unknown;
|
|
1915
|
-
case 2: return Reachability.Public;
|
|
1916
|
-
case 3: return Reachability.Private;
|
|
1917
|
-
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
1921
|
-
switch (value) {
|
|
1922
|
-
case Reachability.Unknown: return c.writeI32(1);
|
|
1923
|
-
case Reachability.Public: return c.writeI32(2);
|
|
1924
|
-
case Reachability.Private: return c.writeI32(3);
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
allocationSize(value: TypeName): number {
|
|
1928
|
-
return 4;
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
return new FFIConverter();
|
|
1932
|
-
})();
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
// Enum: PathKind
|
|
1936
|
-
export enum PathKind_Tags {
|
|
1937
|
-
DirectDialed = "DirectDialed",
|
|
1938
|
-
DirectPunched = "DirectPunched",
|
|
1939
|
-
Relayed = "Relayed"
|
|
1940
|
-
}
|
|
1941
|
-
/**
|
|
1942
|
-
* Kind of usable connection path.
|
|
1943
|
-
*/
|
|
1944
|
-
export const PathKind = (() => {
|
|
1945
|
-
|
|
1946
|
-
type DirectDialed__interface = {
|
|
1947
|
-
tag: PathKind_Tags.DirectDialed
|
|
1948
|
-
};
|
|
1949
|
-
/**
|
|
1950
|
-
* A known address was dialed directly.
|
|
1951
|
-
*/
|
|
1952
|
-
class DirectDialed_ extends UniffiEnum implements DirectDialed__interface {
|
|
1953
|
-
/**
|
|
1954
|
-
* @private
|
|
1955
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1956
|
-
*/
|
|
1957
|
-
readonly [uniffiTypeNameSymbol] = "PathKind";
|
|
1958
|
-
readonly tag = PathKind_Tags.DirectDialed;
|
|
1959
|
-
constructor() {
|
|
1960
|
-
super("PathKind", "DirectDialed");
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
static new(): DirectDialed_ {
|
|
1964
|
-
return new DirectDialed_();
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
static instanceOf(obj: any): obj is DirectDialed_ {
|
|
1968
|
-
return obj.tag === PathKind_Tags.DirectDialed;
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
type DirectPunched__interface = {
|
|
1974
|
-
tag: PathKind_Tags.DirectPunched
|
|
1975
|
-
};
|
|
1976
|
-
/**
|
|
1977
|
-
* A direct path was established by hole punching.
|
|
1978
|
-
*/
|
|
1979
|
-
class DirectPunched_ extends UniffiEnum implements DirectPunched__interface {
|
|
1980
|
-
/**
|
|
1981
|
-
* @private
|
|
1982
|
-
* This field is private and should not be used, use `tag` instead.
|
|
1983
|
-
*/
|
|
1984
|
-
readonly [uniffiTypeNameSymbol] = "PathKind";
|
|
1985
|
-
readonly tag = PathKind_Tags.DirectPunched;
|
|
1986
|
-
constructor() {
|
|
1987
|
-
super("PathKind", "DirectPunched");
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
static new(): DirectPunched_ {
|
|
1991
|
-
return new DirectPunched_();
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
static instanceOf(obj: any): obj is DirectPunched_ {
|
|
1995
|
-
return obj.tag === PathKind_Tags.DirectPunched;
|
|
1996
|
-
}
|
|
1997
|
-
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
type Relayed__interface = {
|
|
2001
|
-
tag: PathKind_Tags.Relayed;
|
|
2002
|
-
inner:
|
|
2003
|
-
Readonly<{relayPeerId: string}>
|
|
2004
|
-
};
|
|
2005
|
-
/**
|
|
2006
|
-
* Traffic is carried through a relay.
|
|
2007
|
-
*/
|
|
2008
|
-
class Relayed_ extends UniffiEnum implements Relayed__interface {
|
|
2009
|
-
/**
|
|
2010
|
-
* @private
|
|
2011
|
-
* This field is private and should not be used, use `tag` instead.
|
|
2012
|
-
*/
|
|
2013
|
-
readonly [uniffiTypeNameSymbol] = "PathKind";
|
|
2014
|
-
readonly tag = PathKind_Tags.Relayed;
|
|
2015
|
-
readonly inner:
|
|
2016
|
-
Readonly<{relayPeerId: string}>;
|
|
2017
|
-
constructor(
|
|
2018
|
-
inner: {relayPeerId: string }) {
|
|
2019
|
-
super("PathKind", "Relayed");
|
|
2398
|
+
/**
|
|
2399
|
+
* A traversal protocol exchange failed.
|
|
2400
|
+
*/
|
|
2401
|
+
Protocol,
|
|
2402
|
+
/**
|
|
2403
|
+
* A relay refused the circuit.
|
|
2404
|
+
*/
|
|
2405
|
+
RelayRefused
|
|
2406
|
+
}
|
|
2020
2407
|
|
|
2021
|
-
|
|
2408
|
+
const FfiConverterTypeNatErrorKind = (() => {
|
|
2409
|
+
type TypeName = NatErrorKind;
|
|
2410
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2411
|
+
readFromCursor(c: Cursor): TypeName {
|
|
2412
|
+
switch (c.readI32()) {
|
|
2413
|
+
case 1: return NatErrorKind.NoPathAvailable;
|
|
2414
|
+
case 2: return NatErrorKind.Timeout;
|
|
2415
|
+
case 3: return NatErrorKind.DialFailed;
|
|
2416
|
+
case 4: return NatErrorKind.Protocol;
|
|
2417
|
+
case 5: return NatErrorKind.RelayRefused;
|
|
2418
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2419
|
+
}
|
|
2022
2420
|
}
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2421
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
2422
|
+
switch (value) {
|
|
2423
|
+
case NatErrorKind.NoPathAvailable: return c.writeI32(1);
|
|
2424
|
+
case NatErrorKind.Timeout: return c.writeI32(2);
|
|
2425
|
+
case NatErrorKind.DialFailed: return c.writeI32(3);
|
|
2426
|
+
case NatErrorKind.Protocol: return c.writeI32(4);
|
|
2427
|
+
case NatErrorKind.RelayRefused: return c.writeI32(5);
|
|
2428
|
+
}
|
|
2026
2429
|
}
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
return obj.tag === PathKind_Tags.Relayed;
|
|
2430
|
+
allocationSize(value: TypeName): number {
|
|
2431
|
+
return 4;
|
|
2030
2432
|
}
|
|
2031
|
-
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
function instanceOf(obj: any): obj is PathKind {
|
|
2035
|
-
return obj[uniffiTypeNameSymbol] === "PathKind";
|
|
2036
2433
|
}
|
|
2037
|
-
|
|
2038
|
-
return Object.freeze({
|
|
2039
|
-
instanceOf,
|
|
2040
|
-
DirectDialed: DirectDialed_,
|
|
2041
|
-
DirectPunched: DirectPunched_,
|
|
2042
|
-
Relayed: Relayed_
|
|
2043
|
-
});
|
|
2044
|
-
|
|
2434
|
+
return new FFIConverter();
|
|
2045
2435
|
})();
|
|
2436
|
+
|
|
2046
2437
|
/**
|
|
2047
|
-
*
|
|
2438
|
+
* Coarse local reachability state.
|
|
2048
2439
|
*/
|
|
2049
|
-
export
|
|
2050
|
-
|
|
2051
|
-
|
|
2440
|
+
export enum Reachability {
|
|
2441
|
+
/**
|
|
2442
|
+
* Not enough evidence is available.
|
|
2443
|
+
*/
|
|
2444
|
+
Unknown,
|
|
2445
|
+
/**
|
|
2446
|
+
* The endpoint is directly reachable.
|
|
2447
|
+
*/
|
|
2448
|
+
Public,
|
|
2449
|
+
/**
|
|
2450
|
+
* The endpoint needs traversal or relay assistance.
|
|
2451
|
+
*/
|
|
2452
|
+
Private
|
|
2453
|
+
}
|
|
2052
2454
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
type TypeName = PathKind;
|
|
2455
|
+
const FfiConverterTypeReachability = (() => {
|
|
2456
|
+
type TypeName = Reachability;
|
|
2056
2457
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2057
2458
|
readFromCursor(c: Cursor): TypeName {
|
|
2058
2459
|
switch (c.readI32()) {
|
|
2059
|
-
case 1: return
|
|
2060
|
-
case 2: return
|
|
2061
|
-
case 3: return
|
|
2460
|
+
case 1: return Reachability.Unknown;
|
|
2461
|
+
case 2: return Reachability.Public;
|
|
2462
|
+
case 3: return Reachability.Private;
|
|
2062
2463
|
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2063
2464
|
}
|
|
2064
2465
|
}
|
|
2065
2466
|
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
2066
|
-
switch (value
|
|
2067
|
-
case
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
}
|
|
2071
|
-
case PathKind_Tags.DirectPunched: {
|
|
2072
|
-
c.writeI32(2);
|
|
2073
|
-
return;
|
|
2074
|
-
}
|
|
2075
|
-
case PathKind_Tags.Relayed: {
|
|
2076
|
-
c.writeI32(3);
|
|
2077
|
-
const inner = value.inner;
|
|
2078
|
-
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
2079
|
-
return;
|
|
2080
|
-
}
|
|
2081
|
-
default:
|
|
2082
|
-
// Throwing from here means that PathKind_Tags hasn't matched an ordinal.
|
|
2083
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2467
|
+
switch (value) {
|
|
2468
|
+
case Reachability.Unknown: return c.writeI32(1);
|
|
2469
|
+
case Reachability.Public: return c.writeI32(2);
|
|
2470
|
+
case Reachability.Private: return c.writeI32(3);
|
|
2084
2471
|
}
|
|
2085
2472
|
}
|
|
2086
2473
|
allocationSize(value: TypeName): number {
|
|
2087
|
-
|
|
2088
|
-
case PathKind_Tags.DirectDialed: {
|
|
2089
|
-
return 4;
|
|
2090
|
-
}
|
|
2091
|
-
case PathKind_Tags.DirectPunched: {
|
|
2092
|
-
return 4;
|
|
2093
|
-
}
|
|
2094
|
-
case PathKind_Tags.Relayed: {
|
|
2095
|
-
const inner = value.inner;
|
|
2096
|
-
let size = 4;
|
|
2097
|
-
size += FfiConverterString.allocationSize(inner.relayPeerId);
|
|
2098
|
-
return size;
|
|
2099
|
-
}
|
|
2100
|
-
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2101
|
-
}
|
|
2474
|
+
return 4;
|
|
2102
2475
|
}
|
|
2103
2476
|
}
|
|
2104
2477
|
return new FFIConverter();
|
|
@@ -2109,6 +2482,7 @@ const FfiConverterTypePathKind = (() => {
|
|
|
2109
2482
|
export enum P2pEvent_Tags {
|
|
2110
2483
|
EventsDropped = "EventsDropped",
|
|
2111
2484
|
DriverFailed = "DriverFailed",
|
|
2485
|
+
EndpointClosed = "EndpointClosed",
|
|
2112
2486
|
ConnectionEstablished = "ConnectionEstablished",
|
|
2113
2487
|
ConnectionClosed = "ConnectionClosed",
|
|
2114
2488
|
ConnectionReplaced = "ConnectionReplaced",
|
|
@@ -2124,6 +2498,7 @@ export enum P2pEvent_Tags {
|
|
|
2124
2498
|
StreamClosed = "StreamClosed",
|
|
2125
2499
|
EndpointError = "EndpointError",
|
|
2126
2500
|
ReachabilityChanged = "ReachabilityChanged",
|
|
2501
|
+
ListenAddressesChanged = "ListenAddressesChanged",
|
|
2127
2502
|
PublicAddressesChanged = "PublicAddressesChanged",
|
|
2128
2503
|
RelayReserved = "RelayReserved",
|
|
2129
2504
|
RelayReservationLost = "RelayReservationLost",
|
|
@@ -2220,6 +2595,42 @@ inner: {kind: DriverFailureKind; detail: string }): DriverFailed_ {
|
|
|
2220
2595
|
|
|
2221
2596
|
}
|
|
2222
2597
|
|
|
2598
|
+
type EndpointClosed__interface = {
|
|
2599
|
+
tag: P2pEvent_Tags.EndpointClosed;
|
|
2600
|
+
inner:
|
|
2601
|
+
Readonly<{outcome: CloseOutcome; unfinished: Array<UnfinishedConnection>}>
|
|
2602
|
+
};
|
|
2603
|
+
/**
|
|
2604
|
+
* The driver finished shutting down: its last event, after
|
|
2605
|
+
* [`P2pEndpoint::stop`](crate::P2pEndpoint::stop) or a
|
|
2606
|
+
* [`P2pEvent::DriverFailed`], when a failed driver tears down at once.
|
|
2607
|
+
*/
|
|
2608
|
+
class EndpointClosed_ extends UniffiEnum implements EndpointClosed__interface {
|
|
2609
|
+
/**
|
|
2610
|
+
* @private
|
|
2611
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2612
|
+
*/
|
|
2613
|
+
readonly [uniffiTypeNameSymbol] = "P2pEvent";
|
|
2614
|
+
readonly tag = P2pEvent_Tags.EndpointClosed;
|
|
2615
|
+
readonly inner:
|
|
2616
|
+
Readonly<{outcome: CloseOutcome; unfinished: Array<UnfinishedConnection>}>;
|
|
2617
|
+
constructor(
|
|
2618
|
+
inner: {outcome: CloseOutcome; unfinished: Array<UnfinishedConnection> }) {
|
|
2619
|
+
super("P2pEvent", "EndpointClosed");
|
|
2620
|
+
|
|
2621
|
+
this.inner = Object.freeze(inner);
|
|
2622
|
+
}
|
|
2623
|
+
static new(
|
|
2624
|
+
inner: {outcome: CloseOutcome; unfinished: Array<UnfinishedConnection> }): EndpointClosed_ {
|
|
2625
|
+
return new EndpointClosed_(inner);
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
static instanceOf(obj: any): obj is EndpointClosed_ {
|
|
2629
|
+
return obj.tag === P2pEvent_Tags.EndpointClosed;
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2223
2634
|
type ConnectionEstablished__interface = {
|
|
2224
2635
|
tag: P2pEvent_Tags.ConnectionEstablished;
|
|
2225
2636
|
inner:
|
|
@@ -2257,7 +2668,7 @@ inner: {peerId: string; connId: bigint }): ConnectionEstablished_ {
|
|
|
2257
2668
|
type ConnectionClosed__interface = {
|
|
2258
2669
|
tag: P2pEvent_Tags.ConnectionClosed;
|
|
2259
2670
|
inner:
|
|
2260
|
-
Readonly<{peerId: string; connId: bigint}>
|
|
2671
|
+
Readonly<{peerId: string; connId: bigint; reason: ConnectionCloseReason}>
|
|
2261
2672
|
};
|
|
2262
2673
|
/**
|
|
2263
2674
|
* The peer's last connection closed; the peer is now disconnected.
|
|
@@ -2270,15 +2681,15 @@ Readonly<{peerId: string; connId: bigint}>
|
|
|
2270
2681
|
readonly [uniffiTypeNameSymbol] = "P2pEvent";
|
|
2271
2682
|
readonly tag = P2pEvent_Tags.ConnectionClosed;
|
|
2272
2683
|
readonly inner:
|
|
2273
|
-
Readonly<{peerId: string; connId: bigint}>;
|
|
2684
|
+
Readonly<{peerId: string; connId: bigint; reason: ConnectionCloseReason}>;
|
|
2274
2685
|
constructor(
|
|
2275
|
-
inner: {peerId: string; connId: bigint }) {
|
|
2686
|
+
inner: {peerId: string; connId: bigint; reason: ConnectionCloseReason }) {
|
|
2276
2687
|
super("P2pEvent", "ConnectionClosed");
|
|
2277
2688
|
|
|
2278
2689
|
this.inner = Object.freeze(inner);
|
|
2279
2690
|
}
|
|
2280
2691
|
static new(
|
|
2281
|
-
inner: {peerId: string; connId: bigint }): ConnectionClosed_ {
|
|
2692
|
+
inner: {peerId: string; connId: bigint; reason: ConnectionCloseReason }): ConnectionClosed_ {
|
|
2282
2693
|
return new ConnectionClosed_(inner);
|
|
2283
2694
|
}
|
|
2284
2695
|
|
|
@@ -2737,6 +3148,43 @@ inner: {previous: Reachability; current: Reachability; confirmedAddrs: Array<str
|
|
|
2737
3148
|
|
|
2738
3149
|
}
|
|
2739
3150
|
|
|
3151
|
+
type ListenAddressesChanged__interface = {
|
|
3152
|
+
tag: P2pEvent_Tags.ListenAddressesChanged;
|
|
3153
|
+
inner:
|
|
3154
|
+
Readonly<{addrs: Array<string>}>
|
|
3155
|
+
};
|
|
3156
|
+
/**
|
|
3157
|
+
* The listen set changed without a `listen` call, as when a
|
|
3158
|
+
* WebTransport listener's certificate rotates: `addrs` is the whole new
|
|
3159
|
+
* set, with `/p2p/<local>`, for the app to republish. External and
|
|
3160
|
+
* public address changes never fire it.
|
|
3161
|
+
*/
|
|
3162
|
+
class ListenAddressesChanged_ extends UniffiEnum implements ListenAddressesChanged__interface {
|
|
3163
|
+
/**
|
|
3164
|
+
* @private
|
|
3165
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3166
|
+
*/
|
|
3167
|
+
readonly [uniffiTypeNameSymbol] = "P2pEvent";
|
|
3168
|
+
readonly tag = P2pEvent_Tags.ListenAddressesChanged;
|
|
3169
|
+
readonly inner:
|
|
3170
|
+
Readonly<{addrs: Array<string>}>;
|
|
3171
|
+
constructor(
|
|
3172
|
+
inner: {addrs: Array<string> }) {
|
|
3173
|
+
super("P2pEvent", "ListenAddressesChanged");
|
|
3174
|
+
|
|
3175
|
+
this.inner = Object.freeze(inner);
|
|
3176
|
+
}
|
|
3177
|
+
static new(
|
|
3178
|
+
inner: {addrs: Array<string> }): ListenAddressesChanged_ {
|
|
3179
|
+
return new ListenAddressesChanged_(inner);
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
static instanceOf(obj: any): obj is ListenAddressesChanged_ {
|
|
3183
|
+
return obj.tag === P2pEvent_Tags.ListenAddressesChanged;
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
}
|
|
3187
|
+
|
|
2740
3188
|
type PublicAddressesChanged__interface = {
|
|
2741
3189
|
tag: P2pEvent_Tags.PublicAddressesChanged;
|
|
2742
3190
|
inner:
|
|
@@ -3495,6 +3943,7 @@ inner: {peerId?: string; source: DiscoverySource; reason: string; suppressed: nu
|
|
|
3495
3943
|
instanceOf,
|
|
3496
3944
|
EventsDropped: EventsDropped_,
|
|
3497
3945
|
DriverFailed: DriverFailed_,
|
|
3946
|
+
EndpointClosed: EndpointClosed_,
|
|
3498
3947
|
ConnectionEstablished: ConnectionEstablished_,
|
|
3499
3948
|
ConnectionClosed: ConnectionClosed_,
|
|
3500
3949
|
ConnectionReplaced: ConnectionReplaced_,
|
|
@@ -3510,6 +3959,7 @@ inner: {peerId?: string; source: DiscoverySource; reason: string; suppressed: nu
|
|
|
3510
3959
|
StreamClosed: StreamClosed_,
|
|
3511
3960
|
EndpointError: EndpointError_,
|
|
3512
3961
|
ReachabilityChanged: ReachabilityChanged_,
|
|
3962
|
+
ListenAddressesChanged: ListenAddressesChanged_,
|
|
3513
3963
|
PublicAddressesChanged: PublicAddressesChanged_,
|
|
3514
3964
|
RelayReserved: RelayReserved_,
|
|
3515
3965
|
RelayReservationLost: RelayReservationLost_,
|
|
@@ -3539,7 +3989,7 @@ inner: {peerId?: string; source: DiscoverySource; reason: string; suppressed: nu
|
|
|
3539
3989
|
* Event delivered by the native endpoint driver.
|
|
3540
3990
|
*/
|
|
3541
3991
|
export type P2pEvent = InstanceType<
|
|
3542
|
-
typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'ConnectionReplaced' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamWriteAccepted' | 'StreamWriteStopped' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | 'ConnectFailed' | 'ConnectCancelled' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'GossipsubOutboundFailure' | 'GossipsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'MdnsFailed' | 'MdnsRecovered' | 'DiscoveryProtocolViolation']
|
|
3992
|
+
typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'EndpointClosed' | 'ConnectionEstablished' | 'ConnectionClosed' | 'ConnectionReplaced' | 'PeerReady' | 'IdentifyReceived' | 'PingRttMeasured' | 'PingTimeout' | 'StreamReady' | 'StreamData' | 'StreamWriteAccepted' | 'StreamWriteStopped' | 'StreamRemoteWriteClosed' | 'StreamClosed' | 'EndpointError' | 'ReachabilityChanged' | 'ListenAddressesChanged' | 'PublicAddressesChanged' | 'RelayReserved' | 'RelayReservationLost' | 'PathEstablished' | 'InboundPathEstablished' | 'PathUpgraded' | 'HolePunchFailed' | 'ConnectFailed' | 'ConnectCancelled' | 'InboundDirectUpgrade' | 'Message' | 'PeerSubscribed' | 'PeerUnsubscribed' | 'GossipsubOutboundFailure' | 'GossipsubProtocolViolation' | 'PeerDiscovered' | 'PeerUpdated' | 'PeerExpired' | 'DiscoveryDialFailed' | 'MdnsFailed' | 'MdnsRecovered' | 'DiscoveryProtocolViolation']
|
|
3543
3993
|
>;
|
|
3544
3994
|
|
|
3545
3995
|
// FfiConverter for enum P2pEvent
|
|
@@ -3550,43 +4000,45 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3550
4000
|
switch (c.readI32()) {
|
|
3551
4001
|
case 1: return new P2pEvent.EventsDropped({dropped: FfiConverterUInt64.readFromCursor(c), totalDropped: FfiConverterUInt64.readFromCursor(c), terminalConnectIds: FfiConverterSequenceUInt64.readFromCursor(c) });
|
|
3552
4002
|
case 2: return new P2pEvent.DriverFailed({kind: FfiConverterTypeDriverFailureKind.readFromCursor(c), detail: FfiConverterString.readFromCursor(c) });
|
|
3553
|
-
case 3: return new P2pEvent.
|
|
3554
|
-
case 4: return new P2pEvent.
|
|
3555
|
-
case 5: return new P2pEvent.
|
|
3556
|
-
case 6: return new P2pEvent.
|
|
3557
|
-
case 7: return new P2pEvent.
|
|
3558
|
-
case 8: return new P2pEvent.
|
|
3559
|
-
case 9: return new P2pEvent.
|
|
3560
|
-
case 10: return new P2pEvent.
|
|
3561
|
-
case 11: return new P2pEvent.
|
|
3562
|
-
case 12: return new P2pEvent.
|
|
3563
|
-
case 13: return new P2pEvent.
|
|
3564
|
-
case 14: return new P2pEvent.
|
|
3565
|
-
case 15: return new P2pEvent.
|
|
3566
|
-
case 16: return new P2pEvent.
|
|
3567
|
-
case 17: return new P2pEvent.
|
|
3568
|
-
case 18: return new P2pEvent.
|
|
3569
|
-
case 19: return new P2pEvent.
|
|
3570
|
-
case 20: return new P2pEvent.
|
|
3571
|
-
case 21: return new P2pEvent.
|
|
3572
|
-
case 22: return new P2pEvent.
|
|
3573
|
-
case 23: return new P2pEvent.
|
|
3574
|
-
case 24: return new P2pEvent.
|
|
3575
|
-
case 25: return new P2pEvent.
|
|
3576
|
-
case 26: return new P2pEvent.
|
|
3577
|
-
case 27: return new P2pEvent.
|
|
3578
|
-
case 28: return new P2pEvent.
|
|
3579
|
-
case 29: return new P2pEvent.
|
|
3580
|
-
case 30: return new P2pEvent.
|
|
3581
|
-
case 31: return new P2pEvent.
|
|
3582
|
-
case 32: return new P2pEvent.
|
|
3583
|
-
case 33: return new P2pEvent.
|
|
3584
|
-
case 34: return new P2pEvent.
|
|
3585
|
-
case 35: return new P2pEvent.
|
|
3586
|
-
case 36: return new P2pEvent.
|
|
3587
|
-
case 37: return new P2pEvent.
|
|
3588
|
-
case 38: return new P2pEvent.
|
|
3589
|
-
case 39: return new P2pEvent.
|
|
4003
|
+
case 3: return new P2pEvent.EndpointClosed({outcome: FfiConverterTypeCloseOutcome.readFromCursor(c), unfinished: FfiConverterSequenceTypeUnfinishedConnection.readFromCursor(c) });
|
|
4004
|
+
case 4: return new P2pEvent.ConnectionEstablished({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c) });
|
|
4005
|
+
case 5: return new P2pEvent.ConnectionClosed({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), reason: FfiConverterTypeConnectionCloseReason.readFromCursor(c) });
|
|
4006
|
+
case 6: return new P2pEvent.ConnectionReplaced({peerId: FfiConverterString.readFromCursor(c), oldConnId: FfiConverterUInt64.readFromCursor(c), newConnId: FfiConverterUInt64.readFromCursor(c) });
|
|
4007
|
+
case 7: return new P2pEvent.PeerReady({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), protocols: FfiConverterSequenceString.readFromCursor(c) });
|
|
4008
|
+
case 8: return new P2pEvent.IdentifyReceived({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), info: FfiConverterTypeIdentifyInfo.readFromCursor(c) });
|
|
4009
|
+
case 9: return new P2pEvent.PingRttMeasured({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), rttMs: FfiConverterUInt64.readFromCursor(c) });
|
|
4010
|
+
case 10: return new P2pEvent.PingTimeout({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c) });
|
|
4011
|
+
case 11: return new P2pEvent.StreamReady({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c), protocolId: FfiConverterString.readFromCursor(c), initiatedLocally: FfiConverterBool.readFromCursor(c) });
|
|
4012
|
+
case 12: return new P2pEvent.StreamData({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c), data: FfiConverterArrayBuffer.readFromCursor(c) });
|
|
4013
|
+
case 13: return new P2pEvent.StreamWriteAccepted({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c) });
|
|
4014
|
+
case 14: return new P2pEvent.StreamWriteStopped({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c), errorCode: FfiConverterUInt64.readFromCursor(c) });
|
|
4015
|
+
case 15: return new P2pEvent.StreamRemoteWriteClosed({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c) });
|
|
4016
|
+
case 16: return new P2pEvent.StreamClosed({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c) });
|
|
4017
|
+
case 17: return new P2pEvent.EndpointError({kind: FfiConverterTypeEndpointErrorKind.readFromCursor(c), peerId: FfiConverterOptionalString.readFromCursor(c), connId: FfiConverterOptionalUInt64.readFromCursor(c), streamId: FfiConverterOptionalUInt64.readFromCursor(c), detail: FfiConverterString.readFromCursor(c) });
|
|
4018
|
+
case 18: return new P2pEvent.ReachabilityChanged({previous: FfiConverterTypeReachability.readFromCursor(c), current: FfiConverterTypeReachability.readFromCursor(c), confirmedAddrs: FfiConverterSequenceString.readFromCursor(c) });
|
|
4019
|
+
case 19: return new P2pEvent.ListenAddressesChanged({addrs: FfiConverterSequenceString.readFromCursor(c) });
|
|
4020
|
+
case 20: return new P2pEvent.PublicAddressesChanged({addrs: FfiConverterSequenceString.readFromCursor(c) });
|
|
4021
|
+
case 21: return new P2pEvent.RelayReserved({relayPeerId: FfiConverterString.readFromCursor(c), expiresUnixSecs: FfiConverterOptionalUInt64.readFromCursor(c) });
|
|
4022
|
+
case 22: return new P2pEvent.RelayReservationLost({relayPeerId: FfiConverterString.readFromCursor(c) });
|
|
4023
|
+
case 23: return new P2pEvent.PathEstablished({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), path: FfiConverterTypePathKind.readFromCursor(c) });
|
|
4024
|
+
case 24: return new P2pEvent.InboundPathEstablished({peerId: FfiConverterString.readFromCursor(c), path: FfiConverterTypePathKind.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c) });
|
|
4025
|
+
case 25: return new P2pEvent.PathUpgraded({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c), from: FfiConverterTypePathKind.readFromCursor(c), to: FfiConverterTypePathKind.readFromCursor(c), oldConnId: FfiConverterUInt64.readFromCursor(c), newConnId: FfiConverterUInt64.readFromCursor(c) });
|
|
4026
|
+
case 26: return new P2pEvent.HolePunchFailed({connectId: FfiConverterUInt64.readFromCursor(c), attempt: FfiConverterUInt32.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
4027
|
+
case 27: return new P2pEvent.ConnectFailed({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c), kind: FfiConverterTypeNatErrorKind.readFromCursor(c), detail: FfiConverterString.readFromCursor(c) });
|
|
4028
|
+
case 28: return new P2pEvent.ConnectCancelled({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c) });
|
|
4029
|
+
case 29: return new P2pEvent.InboundDirectUpgrade({peerId: FfiConverterString.readFromCursor(c), oldConnId: FfiConverterUInt64.readFromCursor(c), newConnId: FfiConverterUInt64.readFromCursor(c) });
|
|
4030
|
+
case 30: return new P2pEvent.Message({fromPeerId: FfiConverterString.readFromCursor(c), topics: FfiConverterSequenceString.readFromCursor(c), data: FfiConverterArrayBuffer.readFromCursor(c), seqno: FfiConverterArrayBuffer.readFromCursor(c), signed: FfiConverterBool.readFromCursor(c) });
|
|
4031
|
+
case 31: return new P2pEvent.PeerSubscribed({peerId: FfiConverterString.readFromCursor(c), topic: FfiConverterString.readFromCursor(c) });
|
|
4032
|
+
case 32: return new P2pEvent.PeerUnsubscribed({peerId: FfiConverterString.readFromCursor(c), topic: FfiConverterString.readFromCursor(c) });
|
|
4033
|
+
case 33: return new P2pEvent.GossipsubOutboundFailure({peerId: FfiConverterString.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
4034
|
+
case 34: return new P2pEvent.GossipsubProtocolViolation({peerId: FfiConverterString.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
4035
|
+
case 35: return new P2pEvent.PeerDiscovered({peerId: FfiConverterString.readFromCursor(c), addrs: FfiConverterSequenceString.readFromCursor(c), source: FfiConverterTypeDiscoverySource.readFromCursor(c) });
|
|
4036
|
+
case 36: return new P2pEvent.PeerUpdated({peerId: FfiConverterString.readFromCursor(c), addrs: FfiConverterSequenceString.readFromCursor(c), source: FfiConverterTypeDiscoverySource.readFromCursor(c) });
|
|
4037
|
+
case 37: return new P2pEvent.PeerExpired({peerId: FfiConverterString.readFromCursor(c) });
|
|
4038
|
+
case 38: return new P2pEvent.DiscoveryDialFailed({peerId: FfiConverterString.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
4039
|
+
case 39: return new P2pEvent.MdnsFailed({kind: FfiConverterTypeMdnsFailureKind.readFromCursor(c), detail: FfiConverterString.readFromCursor(c) });
|
|
4040
|
+
case 40: return new P2pEvent.MdnsRecovered();
|
|
4041
|
+
case 41: return new P2pEvent.DiscoveryProtocolViolation({peerId: FfiConverterOptionalString.readFromCursor(c), source: FfiConverterTypeDiscoverySource.readFromCursor(c), reason: FfiConverterString.readFromCursor(c), suppressed: FfiConverterUInt32.readFromCursor(c) });
|
|
3590
4042
|
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3591
4043
|
}
|
|
3592
4044
|
}
|
|
@@ -3607,22 +4059,30 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3607
4059
|
FfiConverterString.writeIntoCursor(inner.detail, c);
|
|
3608
4060
|
return;
|
|
3609
4061
|
}
|
|
3610
|
-
case P2pEvent_Tags.
|
|
4062
|
+
case P2pEvent_Tags.EndpointClosed: {
|
|
3611
4063
|
c.writeI32(3);
|
|
3612
4064
|
const inner = value.inner;
|
|
4065
|
+
FfiConverterTypeCloseOutcome.writeIntoCursor(inner.outcome, c);
|
|
4066
|
+
FfiConverterSequenceTypeUnfinishedConnection.writeIntoCursor(inner.unfinished, c);
|
|
4067
|
+
return;
|
|
4068
|
+
}
|
|
4069
|
+
case P2pEvent_Tags.ConnectionEstablished: {
|
|
4070
|
+
c.writeI32(4);
|
|
4071
|
+
const inner = value.inner;
|
|
3613
4072
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3614
4073
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
3615
4074
|
return;
|
|
3616
4075
|
}
|
|
3617
4076
|
case P2pEvent_Tags.ConnectionClosed: {
|
|
3618
|
-
c.writeI32(
|
|
4077
|
+
c.writeI32(5);
|
|
3619
4078
|
const inner = value.inner;
|
|
3620
4079
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3621
4080
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
4081
|
+
FfiConverterTypeConnectionCloseReason.writeIntoCursor(inner.reason, c);
|
|
3622
4082
|
return;
|
|
3623
4083
|
}
|
|
3624
4084
|
case P2pEvent_Tags.ConnectionReplaced: {
|
|
3625
|
-
c.writeI32(
|
|
4085
|
+
c.writeI32(6);
|
|
3626
4086
|
const inner = value.inner;
|
|
3627
4087
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3628
4088
|
FfiConverterUInt64.writeIntoCursor(inner.oldConnId, c);
|
|
@@ -3630,7 +4090,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3630
4090
|
return;
|
|
3631
4091
|
}
|
|
3632
4092
|
case P2pEvent_Tags.PeerReady: {
|
|
3633
|
-
c.writeI32(
|
|
4093
|
+
c.writeI32(7);
|
|
3634
4094
|
const inner = value.inner;
|
|
3635
4095
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3636
4096
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3638,7 +4098,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3638
4098
|
return;
|
|
3639
4099
|
}
|
|
3640
4100
|
case P2pEvent_Tags.IdentifyReceived: {
|
|
3641
|
-
c.writeI32(
|
|
4101
|
+
c.writeI32(8);
|
|
3642
4102
|
const inner = value.inner;
|
|
3643
4103
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3644
4104
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3646,7 +4106,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3646
4106
|
return;
|
|
3647
4107
|
}
|
|
3648
4108
|
case P2pEvent_Tags.PingRttMeasured: {
|
|
3649
|
-
c.writeI32(
|
|
4109
|
+
c.writeI32(9);
|
|
3650
4110
|
const inner = value.inner;
|
|
3651
4111
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3652
4112
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3654,14 +4114,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3654
4114
|
return;
|
|
3655
4115
|
}
|
|
3656
4116
|
case P2pEvent_Tags.PingTimeout: {
|
|
3657
|
-
c.writeI32(
|
|
4117
|
+
c.writeI32(10);
|
|
3658
4118
|
const inner = value.inner;
|
|
3659
4119
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3660
4120
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
3661
4121
|
return;
|
|
3662
4122
|
}
|
|
3663
4123
|
case P2pEvent_Tags.StreamReady: {
|
|
3664
|
-
c.writeI32(
|
|
4124
|
+
c.writeI32(11);
|
|
3665
4125
|
const inner = value.inner;
|
|
3666
4126
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3667
4127
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3671,7 +4131,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3671
4131
|
return;
|
|
3672
4132
|
}
|
|
3673
4133
|
case P2pEvent_Tags.StreamData: {
|
|
3674
|
-
c.writeI32(
|
|
4134
|
+
c.writeI32(12);
|
|
3675
4135
|
const inner = value.inner;
|
|
3676
4136
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3677
4137
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3680,7 +4140,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3680
4140
|
return;
|
|
3681
4141
|
}
|
|
3682
4142
|
case P2pEvent_Tags.StreamWriteAccepted: {
|
|
3683
|
-
c.writeI32(
|
|
4143
|
+
c.writeI32(13);
|
|
3684
4144
|
const inner = value.inner;
|
|
3685
4145
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3686
4146
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3688,7 +4148,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3688
4148
|
return;
|
|
3689
4149
|
}
|
|
3690
4150
|
case P2pEvent_Tags.StreamWriteStopped: {
|
|
3691
|
-
c.writeI32(
|
|
4151
|
+
c.writeI32(14);
|
|
3692
4152
|
const inner = value.inner;
|
|
3693
4153
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3694
4154
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3697,7 +4157,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3697
4157
|
return;
|
|
3698
4158
|
}
|
|
3699
4159
|
case P2pEvent_Tags.StreamRemoteWriteClosed: {
|
|
3700
|
-
c.writeI32(
|
|
4160
|
+
c.writeI32(15);
|
|
3701
4161
|
const inner = value.inner;
|
|
3702
4162
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3703
4163
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3705,7 +4165,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3705
4165
|
return;
|
|
3706
4166
|
}
|
|
3707
4167
|
case P2pEvent_Tags.StreamClosed: {
|
|
3708
|
-
c.writeI32(
|
|
4168
|
+
c.writeI32(16);
|
|
3709
4169
|
const inner = value.inner;
|
|
3710
4170
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3711
4171
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3713,7 +4173,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3713
4173
|
return;
|
|
3714
4174
|
}
|
|
3715
4175
|
case P2pEvent_Tags.EndpointError: {
|
|
3716
|
-
c.writeI32(
|
|
4176
|
+
c.writeI32(17);
|
|
3717
4177
|
const inner = value.inner;
|
|
3718
4178
|
FfiConverterTypeEndpointErrorKind.writeIntoCursor(inner.kind, c);
|
|
3719
4179
|
FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3723,34 +4183,40 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3723
4183
|
return;
|
|
3724
4184
|
}
|
|
3725
4185
|
case P2pEvent_Tags.ReachabilityChanged: {
|
|
3726
|
-
c.writeI32(
|
|
4186
|
+
c.writeI32(18);
|
|
3727
4187
|
const inner = value.inner;
|
|
3728
4188
|
FfiConverterTypeReachability.writeIntoCursor(inner.previous, c);
|
|
3729
4189
|
FfiConverterTypeReachability.writeIntoCursor(inner.current, c);
|
|
3730
4190
|
FfiConverterSequenceString.writeIntoCursor(inner.confirmedAddrs, c);
|
|
3731
4191
|
return;
|
|
3732
4192
|
}
|
|
4193
|
+
case P2pEvent_Tags.ListenAddressesChanged: {
|
|
4194
|
+
c.writeI32(19);
|
|
4195
|
+
const inner = value.inner;
|
|
4196
|
+
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
4197
|
+
return;
|
|
4198
|
+
}
|
|
3733
4199
|
case P2pEvent_Tags.PublicAddressesChanged: {
|
|
3734
|
-
c.writeI32(
|
|
4200
|
+
c.writeI32(20);
|
|
3735
4201
|
const inner = value.inner;
|
|
3736
4202
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
3737
4203
|
return;
|
|
3738
4204
|
}
|
|
3739
4205
|
case P2pEvent_Tags.RelayReserved: {
|
|
3740
|
-
c.writeI32(
|
|
4206
|
+
c.writeI32(21);
|
|
3741
4207
|
const inner = value.inner;
|
|
3742
4208
|
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
3743
4209
|
FfiConverterOptionalUInt64.writeIntoCursor(inner.expiresUnixSecs, c);
|
|
3744
4210
|
return;
|
|
3745
4211
|
}
|
|
3746
4212
|
case P2pEvent_Tags.RelayReservationLost: {
|
|
3747
|
-
c.writeI32(
|
|
4213
|
+
c.writeI32(22);
|
|
3748
4214
|
const inner = value.inner;
|
|
3749
4215
|
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
3750
4216
|
return;
|
|
3751
4217
|
}
|
|
3752
4218
|
case P2pEvent_Tags.PathEstablished: {
|
|
3753
|
-
c.writeI32(
|
|
4219
|
+
c.writeI32(23);
|
|
3754
4220
|
const inner = value.inner;
|
|
3755
4221
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3756
4222
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3759,7 +4225,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3759
4225
|
return;
|
|
3760
4226
|
}
|
|
3761
4227
|
case P2pEvent_Tags.InboundPathEstablished: {
|
|
3762
|
-
c.writeI32(
|
|
4228
|
+
c.writeI32(24);
|
|
3763
4229
|
const inner = value.inner;
|
|
3764
4230
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3765
4231
|
FfiConverterTypePathKind.writeIntoCursor(inner.path, c);
|
|
@@ -3767,7 +4233,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3767
4233
|
return;
|
|
3768
4234
|
}
|
|
3769
4235
|
case P2pEvent_Tags.PathUpgraded: {
|
|
3770
|
-
c.writeI32(
|
|
4236
|
+
c.writeI32(25);
|
|
3771
4237
|
const inner = value.inner;
|
|
3772
4238
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3773
4239
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3778,7 +4244,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3778
4244
|
return;
|
|
3779
4245
|
}
|
|
3780
4246
|
case P2pEvent_Tags.HolePunchFailed: {
|
|
3781
|
-
c.writeI32(
|
|
4247
|
+
c.writeI32(26);
|
|
3782
4248
|
const inner = value.inner;
|
|
3783
4249
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3784
4250
|
FfiConverterUInt32.writeIntoCursor(inner.attempt, c);
|
|
@@ -3786,7 +4252,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3786
4252
|
return;
|
|
3787
4253
|
}
|
|
3788
4254
|
case P2pEvent_Tags.ConnectFailed: {
|
|
3789
|
-
c.writeI32(
|
|
4255
|
+
c.writeI32(27);
|
|
3790
4256
|
const inner = value.inner;
|
|
3791
4257
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3792
4258
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3795,14 +4261,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3795
4261
|
return;
|
|
3796
4262
|
}
|
|
3797
4263
|
case P2pEvent_Tags.ConnectCancelled: {
|
|
3798
|
-
c.writeI32(
|
|
4264
|
+
c.writeI32(28);
|
|
3799
4265
|
const inner = value.inner;
|
|
3800
4266
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3801
4267
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3802
4268
|
return;
|
|
3803
4269
|
}
|
|
3804
4270
|
case P2pEvent_Tags.InboundDirectUpgrade: {
|
|
3805
|
-
c.writeI32(
|
|
4271
|
+
c.writeI32(29);
|
|
3806
4272
|
const inner = value.inner;
|
|
3807
4273
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3808
4274
|
FfiConverterUInt64.writeIntoCursor(inner.oldConnId, c);
|
|
@@ -3810,7 +4276,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3810
4276
|
return;
|
|
3811
4277
|
}
|
|
3812
4278
|
case P2pEvent_Tags.Message: {
|
|
3813
|
-
c.writeI32(
|
|
4279
|
+
c.writeI32(30);
|
|
3814
4280
|
const inner = value.inner;
|
|
3815
4281
|
FfiConverterString.writeIntoCursor(inner.fromPeerId, c);
|
|
3816
4282
|
FfiConverterSequenceString.writeIntoCursor(inner.topics, c);
|
|
@@ -3820,35 +4286,35 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3820
4286
|
return;
|
|
3821
4287
|
}
|
|
3822
4288
|
case P2pEvent_Tags.PeerSubscribed: {
|
|
3823
|
-
c.writeI32(
|
|
4289
|
+
c.writeI32(31);
|
|
3824
4290
|
const inner = value.inner;
|
|
3825
4291
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3826
4292
|
FfiConverterString.writeIntoCursor(inner.topic, c);
|
|
3827
4293
|
return;
|
|
3828
4294
|
}
|
|
3829
4295
|
case P2pEvent_Tags.PeerUnsubscribed: {
|
|
3830
|
-
c.writeI32(
|
|
4296
|
+
c.writeI32(32);
|
|
3831
4297
|
const inner = value.inner;
|
|
3832
4298
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3833
4299
|
FfiConverterString.writeIntoCursor(inner.topic, c);
|
|
3834
4300
|
return;
|
|
3835
4301
|
}
|
|
3836
4302
|
case P2pEvent_Tags.GossipsubOutboundFailure: {
|
|
3837
|
-
c.writeI32(
|
|
4303
|
+
c.writeI32(33);
|
|
3838
4304
|
const inner = value.inner;
|
|
3839
4305
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3840
4306
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
3841
4307
|
return;
|
|
3842
4308
|
}
|
|
3843
4309
|
case P2pEvent_Tags.GossipsubProtocolViolation: {
|
|
3844
|
-
c.writeI32(
|
|
4310
|
+
c.writeI32(34);
|
|
3845
4311
|
const inner = value.inner;
|
|
3846
4312
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3847
4313
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
3848
4314
|
return;
|
|
3849
4315
|
}
|
|
3850
4316
|
case P2pEvent_Tags.PeerDiscovered: {
|
|
3851
|
-
c.writeI32(
|
|
4317
|
+
c.writeI32(35);
|
|
3852
4318
|
const inner = value.inner;
|
|
3853
4319
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3854
4320
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
@@ -3856,7 +4322,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3856
4322
|
return;
|
|
3857
4323
|
}
|
|
3858
4324
|
case P2pEvent_Tags.PeerUpdated: {
|
|
3859
|
-
c.writeI32(
|
|
4325
|
+
c.writeI32(36);
|
|
3860
4326
|
const inner = value.inner;
|
|
3861
4327
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3862
4328
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
@@ -3864,31 +4330,31 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3864
4330
|
return;
|
|
3865
4331
|
}
|
|
3866
4332
|
case P2pEvent_Tags.PeerExpired: {
|
|
3867
|
-
c.writeI32(
|
|
4333
|
+
c.writeI32(37);
|
|
3868
4334
|
const inner = value.inner;
|
|
3869
4335
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3870
4336
|
return;
|
|
3871
4337
|
}
|
|
3872
4338
|
case P2pEvent_Tags.DiscoveryDialFailed: {
|
|
3873
|
-
c.writeI32(
|
|
4339
|
+
c.writeI32(38);
|
|
3874
4340
|
const inner = value.inner;
|
|
3875
4341
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3876
4342
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
3877
4343
|
return;
|
|
3878
4344
|
}
|
|
3879
4345
|
case P2pEvent_Tags.MdnsFailed: {
|
|
3880
|
-
c.writeI32(
|
|
4346
|
+
c.writeI32(39);
|
|
3881
4347
|
const inner = value.inner;
|
|
3882
4348
|
FfiConverterTypeMdnsFailureKind.writeIntoCursor(inner.kind, c);
|
|
3883
4349
|
FfiConverterString.writeIntoCursor(inner.detail, c);
|
|
3884
4350
|
return;
|
|
3885
4351
|
}
|
|
3886
4352
|
case P2pEvent_Tags.MdnsRecovered: {
|
|
3887
|
-
c.writeI32(
|
|
4353
|
+
c.writeI32(40);
|
|
3888
4354
|
return;
|
|
3889
4355
|
}
|
|
3890
4356
|
case P2pEvent_Tags.DiscoveryProtocolViolation: {
|
|
3891
|
-
c.writeI32(
|
|
4357
|
+
c.writeI32(41);
|
|
3892
4358
|
const inner = value.inner;
|
|
3893
4359
|
FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
|
|
3894
4360
|
FfiConverterTypeDiscoverySource.writeIntoCursor(inner.source, c);
|
|
@@ -3918,6 +4384,13 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3918
4384
|
size += FfiConverterString.allocationSize(inner.detail);
|
|
3919
4385
|
return size;
|
|
3920
4386
|
}
|
|
4387
|
+
case P2pEvent_Tags.EndpointClosed: {
|
|
4388
|
+
const inner = value.inner;
|
|
4389
|
+
let size = 4;
|
|
4390
|
+
size += FfiConverterTypeCloseOutcome.allocationSize(inner.outcome);
|
|
4391
|
+
size += FfiConverterSequenceTypeUnfinishedConnection.allocationSize(inner.unfinished);
|
|
4392
|
+
return size;
|
|
4393
|
+
}
|
|
3921
4394
|
case P2pEvent_Tags.ConnectionEstablished: {
|
|
3922
4395
|
const inner = value.inner;
|
|
3923
4396
|
let size = 4;
|
|
@@ -3930,6 +4403,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3930
4403
|
let size = 4;
|
|
3931
4404
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3932
4405
|
size += FfiConverterUInt64.allocationSize(inner.connId);
|
|
4406
|
+
size += FfiConverterTypeConnectionCloseReason.allocationSize(inner.reason);
|
|
3933
4407
|
return size;
|
|
3934
4408
|
}
|
|
3935
4409
|
case P2pEvent_Tags.ConnectionReplaced: {
|
|
@@ -4041,6 +4515,12 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
4041
4515
|
size += FfiConverterSequenceString.allocationSize(inner.confirmedAddrs);
|
|
4042
4516
|
return size;
|
|
4043
4517
|
}
|
|
4518
|
+
case P2pEvent_Tags.ListenAddressesChanged: {
|
|
4519
|
+
const inner = value.inner;
|
|
4520
|
+
let size = 4;
|
|
4521
|
+
size += FfiConverterSequenceString.allocationSize(inner.addrs);
|
|
4522
|
+
return size;
|
|
4523
|
+
}
|
|
4044
4524
|
case P2pEvent_Tags.PublicAddressesChanged: {
|
|
4045
4525
|
const inner = value.inner;
|
|
4046
4526
|
let size = 4;
|
|
@@ -4213,15 +4693,15 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
4213
4693
|
return new FFIConverter();
|
|
4214
4694
|
})();
|
|
4215
4695
|
|
|
4216
|
-
// FfiConverter for string | undefined
|
|
4217
|
-
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
4218
|
-
|
|
4219
4696
|
// FfiConverter for Array<string>
|
|
4220
4697
|
const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
|
|
4221
4698
|
|
|
4222
4699
|
// FfiConverter for Array<string> | undefined
|
|
4223
4700
|
const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
|
|
4224
4701
|
|
|
4702
|
+
// FfiConverter for string | undefined
|
|
4703
|
+
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
4704
|
+
|
|
4225
4705
|
// FfiConverter for DiscoveryOptions | undefined
|
|
4226
4706
|
const FfiConverterOptionalTypeDiscoveryOptions = new FfiConverterOptional(FfiConverterTypeDiscoveryOptions);
|
|
4227
4707
|
|
|
@@ -4237,6 +4717,9 @@ const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
|
4237
4717
|
// FfiConverter for Array<bigint>
|
|
4238
4718
|
const FfiConverterSequenceUInt64 = new FfiConverterArray(FfiConverterUInt64);
|
|
4239
4719
|
|
|
4720
|
+
// FfiConverter for Array<UnfinishedConnection>
|
|
4721
|
+
const FfiConverterSequenceTypeUnfinishedConnection = new FfiConverterArray(FfiConverterTypeUnfinishedConnection);
|
|
4722
|
+
|
|
4240
4723
|
|
|
4241
4724
|
/**
|
|
4242
4725
|
* This should be called before anything else.
|
|
@@ -4262,8 +4745,10 @@ function uniffiEnsureInitialized() {
|
|
|
4262
4745
|
export default Object.freeze({
|
|
4263
4746
|
initialize: uniffiEnsureInitialized,
|
|
4264
4747
|
converters: {
|
|
4748
|
+
FfiConverterTypeCloseOutcome,
|
|
4265
4749
|
FfiConverterTypeConfigCapability,
|
|
4266
4750
|
FfiConverterTypeConnectTarget,
|
|
4751
|
+
FfiConverterTypeConnectionCloseReason,
|
|
4267
4752
|
FfiConverterTypeConnectionInfo,
|
|
4268
4753
|
FfiConverterTypeDiscoveryOptions,
|
|
4269
4754
|
FfiConverterTypeDiscoverySource,
|
|
@@ -4281,5 +4766,6 @@ export default Object.freeze({
|
|
|
4281
4766
|
FfiConverterTypePathKind,
|
|
4282
4767
|
FfiConverterTypeReachability,
|
|
4283
4768
|
FfiConverterTypeRelayReservationInfo,
|
|
4769
|
+
FfiConverterTypeUnfinishedConnection,
|
|
4284
4770
|
}
|
|
4285
4771
|
});
|