@minip2p/react-native 0.9.1 → 0.10.0
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/Info.plist +4 -4
- 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 +639 -264
- 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 +424 -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 +701 -267
- 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
|
+
}
|
|
81
|
+
/**
|
|
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
|
+
|
|
74
247
|
/**
|
|
75
|
-
* State snapshot of
|
|
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`.
|
|
84
263
|
*/
|
|
85
|
-
remoteAddr
|
|
264
|
+
remoteAddr: string,
|
|
265
|
+
/**
|
|
266
|
+
* How the connection was made.
|
|
267
|
+
*/
|
|
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.
|
|
@@ -866,10 +1152,270 @@ const FfiConverterTypeConnectTarget = (() => {
|
|
|
866
1152
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
867
1153
|
return size;
|
|
868
1154
|
}
|
|
869
|
-
case ConnectTarget_Tags.Addresses: {
|
|
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;
|
|
1211
|
+
inner:
|
|
1212
|
+
Readonly<{code: bigint}>
|
|
1213
|
+
};
|
|
1214
|
+
/**
|
|
1215
|
+
* The peer closed it with `code`: its QUIC CONNECTION_CLOSE code, or
|
|
1216
|
+
* its Yamux `GoAway` code on TCP and relay circuits.
|
|
1217
|
+
*/
|
|
1218
|
+
class Remote_ extends UniffiEnum implements Remote__interface {
|
|
1219
|
+
/**
|
|
1220
|
+
* @private
|
|
1221
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1222
|
+
*/
|
|
1223
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1224
|
+
readonly tag = ConnectionCloseReason_Tags.Remote;
|
|
1225
|
+
readonly inner:
|
|
1226
|
+
Readonly<{code: bigint}>;
|
|
1227
|
+
constructor(
|
|
1228
|
+
inner: {code: bigint }) {
|
|
1229
|
+
super("ConnectionCloseReason", "Remote");
|
|
1230
|
+
|
|
1231
|
+
this.inner = Object.freeze(inner);
|
|
1232
|
+
}
|
|
1233
|
+
static new(
|
|
1234
|
+
inner: {code: bigint }): Remote_ {
|
|
1235
|
+
return new Remote_(inner);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
static instanceOf(obj: any): obj is Remote_ {
|
|
1239
|
+
return obj.tag === ConnectionCloseReason_Tags.Remote;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
}
|
|
1243
|
+
|
|
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;
|
|
1300
|
+
inner:
|
|
1301
|
+
Readonly<{message: string}>
|
|
1302
|
+
};
|
|
1303
|
+
/**
|
|
1304
|
+
* Anything else that ended it.
|
|
1305
|
+
*/
|
|
1306
|
+
class Error_ extends UniffiEnum implements Error__interface {
|
|
1307
|
+
/**
|
|
1308
|
+
* @private
|
|
1309
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1310
|
+
*/
|
|
1311
|
+
readonly [uniffiTypeNameSymbol] = "ConnectionCloseReason";
|
|
1312
|
+
readonly tag = ConnectionCloseReason_Tags.Error;
|
|
1313
|
+
readonly inner:
|
|
1314
|
+
Readonly<{message: string}>;
|
|
1315
|
+
constructor(
|
|
1316
|
+
inner: {message: string }) {
|
|
1317
|
+
super("ConnectionCloseReason", "Error");
|
|
1318
|
+
|
|
1319
|
+
this.inner = Object.freeze(inner);
|
|
1320
|
+
}
|
|
1321
|
+
static new(
|
|
1322
|
+
inner: {message: string }): Error_ {
|
|
1323
|
+
return new Error_(inner);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
static instanceOf(obj: any): obj is Error_ {
|
|
1327
|
+
return obj.tag === ConnectionCloseReason_Tags.Error;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
function instanceOf(obj: any): obj is ConnectionCloseReason {
|
|
1333
|
+
return obj[uniffiTypeNameSymbol] === "ConnectionCloseReason";
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
return Object.freeze({
|
|
1337
|
+
instanceOf,
|
|
1338
|
+
Local: Local_,
|
|
1339
|
+
Remote: Remote_,
|
|
1340
|
+
TimedOut: TimedOut_,
|
|
1341
|
+
Stalled: Stalled_,
|
|
1342
|
+
Error: Error_
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
})();
|
|
1346
|
+
/**
|
|
1347
|
+
* Why one connection ended; see `minip2p::ConnectionCloseReason`.
|
|
1348
|
+
*/
|
|
1349
|
+
export type ConnectionCloseReason = InstanceType<
|
|
1350
|
+
typeof ConnectionCloseReason['Local' | 'Remote' | 'TimedOut' | 'Stalled' | 'Error']
|
|
1351
|
+
>;
|
|
1352
|
+
|
|
1353
|
+
// FfiConverter for enum ConnectionCloseReason
|
|
1354
|
+
const FfiConverterTypeConnectionCloseReason = (() => {
|
|
1355
|
+
type TypeName = ConnectionCloseReason;
|
|
1356
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1357
|
+
readFromCursor(c: Cursor): TypeName {
|
|
1358
|
+
switch (c.readI32()) {
|
|
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) });
|
|
1364
|
+
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
1368
|
+
switch (value.tag) {
|
|
1369
|
+
case ConnectionCloseReason_Tags.Local: {
|
|
1370
|
+
c.writeI32(1);
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
case ConnectionCloseReason_Tags.Remote: {
|
|
1374
|
+
c.writeI32(2);
|
|
1375
|
+
const inner = value.inner;
|
|
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);
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
default:
|
|
1394
|
+
// Throwing from here means that ConnectionCloseReason_Tags hasn't matched an ordinal.
|
|
1395
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
allocationSize(value: TypeName): number {
|
|
1399
|
+
switch (value.tag) {
|
|
1400
|
+
case ConnectionCloseReason_Tags.Local: {
|
|
1401
|
+
return 4;
|
|
1402
|
+
}
|
|
1403
|
+
case ConnectionCloseReason_Tags.Remote: {
|
|
1404
|
+
const inner = value.inner;
|
|
1405
|
+
let size = 4;
|
|
1406
|
+
size += FfiConverterUInt64.allocationSize(inner.code);
|
|
1407
|
+
return size;
|
|
1408
|
+
}
|
|
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();
|
|
@@ -1932,183 +2478,11 @@ const FfiConverterTypeReachability = (() => {
|
|
|
1932
2478
|
})();
|
|
1933
2479
|
|
|
1934
2480
|
|
|
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");
|
|
2020
|
-
|
|
2021
|
-
this.inner = Object.freeze(inner);
|
|
2022
|
-
}
|
|
2023
|
-
static new(
|
|
2024
|
-
inner: {relayPeerId: string }): Relayed_ {
|
|
2025
|
-
return new Relayed_(inner);
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
static instanceOf(obj: any): obj is Relayed_ {
|
|
2029
|
-
return obj.tag === PathKind_Tags.Relayed;
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
function instanceOf(obj: any): obj is PathKind {
|
|
2035
|
-
return obj[uniffiTypeNameSymbol] === "PathKind";
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
return Object.freeze({
|
|
2039
|
-
instanceOf,
|
|
2040
|
-
DirectDialed: DirectDialed_,
|
|
2041
|
-
DirectPunched: DirectPunched_,
|
|
2042
|
-
Relayed: Relayed_
|
|
2043
|
-
});
|
|
2044
|
-
|
|
2045
|
-
})();
|
|
2046
|
-
/**
|
|
2047
|
-
* Kind of usable connection path.
|
|
2048
|
-
*/
|
|
2049
|
-
export type PathKind = InstanceType<
|
|
2050
|
-
typeof PathKind['DirectDialed' | 'DirectPunched' | 'Relayed']
|
|
2051
|
-
>;
|
|
2052
|
-
|
|
2053
|
-
// FfiConverter for enum PathKind
|
|
2054
|
-
const FfiConverterTypePathKind = (() => {
|
|
2055
|
-
type TypeName = PathKind;
|
|
2056
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2057
|
-
readFromCursor(c: Cursor): TypeName {
|
|
2058
|
-
switch (c.readI32()) {
|
|
2059
|
-
case 1: return new PathKind.DirectDialed();
|
|
2060
|
-
case 2: return new PathKind.DirectPunched();
|
|
2061
|
-
case 3: return new PathKind.Relayed({relayPeerId: FfiConverterString.readFromCursor(c) });
|
|
2062
|
-
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
writeIntoCursor(value: TypeName, c: Cursor): void {
|
|
2066
|
-
switch (value.tag) {
|
|
2067
|
-
case PathKind_Tags.DirectDialed: {
|
|
2068
|
-
c.writeI32(1);
|
|
2069
|
-
return;
|
|
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();
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
allocationSize(value: TypeName): number {
|
|
2087
|
-
switch (value.tag) {
|
|
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
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
}
|
|
2104
|
-
return new FFIConverter();
|
|
2105
|
-
})();
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
2481
|
// Enum: P2pEvent
|
|
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",
|
|
@@ -2220,6 +2594,42 @@ inner: {kind: DriverFailureKind; detail: string }): DriverFailed_ {
|
|
|
2220
2594
|
|
|
2221
2595
|
}
|
|
2222
2596
|
|
|
2597
|
+
type EndpointClosed__interface = {
|
|
2598
|
+
tag: P2pEvent_Tags.EndpointClosed;
|
|
2599
|
+
inner:
|
|
2600
|
+
Readonly<{outcome: CloseOutcome; unfinished: Array<UnfinishedConnection>}>
|
|
2601
|
+
};
|
|
2602
|
+
/**
|
|
2603
|
+
* The driver finished shutting down: its last event, after
|
|
2604
|
+
* [`P2pEndpoint::stop`](crate::P2pEndpoint::stop) or a
|
|
2605
|
+
* [`P2pEvent::DriverFailed`], when a failed driver tears down at once.
|
|
2606
|
+
*/
|
|
2607
|
+
class EndpointClosed_ extends UniffiEnum implements EndpointClosed__interface {
|
|
2608
|
+
/**
|
|
2609
|
+
* @private
|
|
2610
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2611
|
+
*/
|
|
2612
|
+
readonly [uniffiTypeNameSymbol] = "P2pEvent";
|
|
2613
|
+
readonly tag = P2pEvent_Tags.EndpointClosed;
|
|
2614
|
+
readonly inner:
|
|
2615
|
+
Readonly<{outcome: CloseOutcome; unfinished: Array<UnfinishedConnection>}>;
|
|
2616
|
+
constructor(
|
|
2617
|
+
inner: {outcome: CloseOutcome; unfinished: Array<UnfinishedConnection> }) {
|
|
2618
|
+
super("P2pEvent", "EndpointClosed");
|
|
2619
|
+
|
|
2620
|
+
this.inner = Object.freeze(inner);
|
|
2621
|
+
}
|
|
2622
|
+
static new(
|
|
2623
|
+
inner: {outcome: CloseOutcome; unfinished: Array<UnfinishedConnection> }): EndpointClosed_ {
|
|
2624
|
+
return new EndpointClosed_(inner);
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
static instanceOf(obj: any): obj is EndpointClosed_ {
|
|
2628
|
+
return obj.tag === P2pEvent_Tags.EndpointClosed;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2223
2633
|
type ConnectionEstablished__interface = {
|
|
2224
2634
|
tag: P2pEvent_Tags.ConnectionEstablished;
|
|
2225
2635
|
inner:
|
|
@@ -2257,7 +2667,7 @@ inner: {peerId: string; connId: bigint }): ConnectionEstablished_ {
|
|
|
2257
2667
|
type ConnectionClosed__interface = {
|
|
2258
2668
|
tag: P2pEvent_Tags.ConnectionClosed;
|
|
2259
2669
|
inner:
|
|
2260
|
-
Readonly<{peerId: string; connId: bigint}>
|
|
2670
|
+
Readonly<{peerId: string; connId: bigint; reason: ConnectionCloseReason}>
|
|
2261
2671
|
};
|
|
2262
2672
|
/**
|
|
2263
2673
|
* The peer's last connection closed; the peer is now disconnected.
|
|
@@ -2270,15 +2680,15 @@ Readonly<{peerId: string; connId: bigint}>
|
|
|
2270
2680
|
readonly [uniffiTypeNameSymbol] = "P2pEvent";
|
|
2271
2681
|
readonly tag = P2pEvent_Tags.ConnectionClosed;
|
|
2272
2682
|
readonly inner:
|
|
2273
|
-
Readonly<{peerId: string; connId: bigint}>;
|
|
2683
|
+
Readonly<{peerId: string; connId: bigint; reason: ConnectionCloseReason}>;
|
|
2274
2684
|
constructor(
|
|
2275
|
-
inner: {peerId: string; connId: bigint }) {
|
|
2685
|
+
inner: {peerId: string; connId: bigint; reason: ConnectionCloseReason }) {
|
|
2276
2686
|
super("P2pEvent", "ConnectionClosed");
|
|
2277
2687
|
|
|
2278
2688
|
this.inner = Object.freeze(inner);
|
|
2279
2689
|
}
|
|
2280
2690
|
static new(
|
|
2281
|
-
inner: {peerId: string; connId: bigint }): ConnectionClosed_ {
|
|
2691
|
+
inner: {peerId: string; connId: bigint; reason: ConnectionCloseReason }): ConnectionClosed_ {
|
|
2282
2692
|
return new ConnectionClosed_(inner);
|
|
2283
2693
|
}
|
|
2284
2694
|
|
|
@@ -3495,6 +3905,7 @@ inner: {peerId?: string; source: DiscoverySource; reason: string; suppressed: nu
|
|
|
3495
3905
|
instanceOf,
|
|
3496
3906
|
EventsDropped: EventsDropped_,
|
|
3497
3907
|
DriverFailed: DriverFailed_,
|
|
3908
|
+
EndpointClosed: EndpointClosed_,
|
|
3498
3909
|
ConnectionEstablished: ConnectionEstablished_,
|
|
3499
3910
|
ConnectionClosed: ConnectionClosed_,
|
|
3500
3911
|
ConnectionReplaced: ConnectionReplaced_,
|
|
@@ -3539,7 +3950,7 @@ inner: {peerId?: string; source: DiscoverySource; reason: string; suppressed: nu
|
|
|
3539
3950
|
* Event delivered by the native endpoint driver.
|
|
3540
3951
|
*/
|
|
3541
3952
|
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']
|
|
3953
|
+
typeof P2pEvent['EventsDropped' | 'DriverFailed' | 'EndpointClosed' | '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']
|
|
3543
3954
|
>;
|
|
3544
3955
|
|
|
3545
3956
|
// FfiConverter for enum P2pEvent
|
|
@@ -3550,43 +3961,44 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3550
3961
|
switch (c.readI32()) {
|
|
3551
3962
|
case 1: return new P2pEvent.EventsDropped({dropped: FfiConverterUInt64.readFromCursor(c), totalDropped: FfiConverterUInt64.readFromCursor(c), terminalConnectIds: FfiConverterSequenceUInt64.readFromCursor(c) });
|
|
3552
3963
|
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.
|
|
3964
|
+
case 3: return new P2pEvent.EndpointClosed({outcome: FfiConverterTypeCloseOutcome.readFromCursor(c), unfinished: FfiConverterSequenceTypeUnfinishedConnection.readFromCursor(c) });
|
|
3965
|
+
case 4: return new P2pEvent.ConnectionEstablished({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c) });
|
|
3966
|
+
case 5: return new P2pEvent.ConnectionClosed({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), reason: FfiConverterTypeConnectionCloseReason.readFromCursor(c) });
|
|
3967
|
+
case 6: return new P2pEvent.ConnectionReplaced({peerId: FfiConverterString.readFromCursor(c), oldConnId: FfiConverterUInt64.readFromCursor(c), newConnId: FfiConverterUInt64.readFromCursor(c) });
|
|
3968
|
+
case 7: return new P2pEvent.PeerReady({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), protocols: FfiConverterSequenceString.readFromCursor(c) });
|
|
3969
|
+
case 8: return new P2pEvent.IdentifyReceived({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), info: FfiConverterTypeIdentifyInfo.readFromCursor(c) });
|
|
3970
|
+
case 9: return new P2pEvent.PingRttMeasured({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), rttMs: FfiConverterUInt64.readFromCursor(c) });
|
|
3971
|
+
case 10: return new P2pEvent.PingTimeout({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c) });
|
|
3972
|
+
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) });
|
|
3973
|
+
case 12: return new P2pEvent.StreamData({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c), data: FfiConverterArrayBuffer.readFromCursor(c) });
|
|
3974
|
+
case 13: return new P2pEvent.StreamWriteAccepted({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c) });
|
|
3975
|
+
case 14: return new P2pEvent.StreamWriteStopped({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c), errorCode: FfiConverterUInt64.readFromCursor(c) });
|
|
3976
|
+
case 15: return new P2pEvent.StreamRemoteWriteClosed({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c) });
|
|
3977
|
+
case 16: return new P2pEvent.StreamClosed({peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), streamId: FfiConverterUInt64.readFromCursor(c) });
|
|
3978
|
+
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) });
|
|
3979
|
+
case 18: return new P2pEvent.ReachabilityChanged({previous: FfiConverterTypeReachability.readFromCursor(c), current: FfiConverterTypeReachability.readFromCursor(c), confirmedAddrs: FfiConverterSequenceString.readFromCursor(c) });
|
|
3980
|
+
case 19: return new P2pEvent.PublicAddressesChanged({addrs: FfiConverterSequenceString.readFromCursor(c) });
|
|
3981
|
+
case 20: return new P2pEvent.RelayReserved({relayPeerId: FfiConverterString.readFromCursor(c), expiresUnixSecs: FfiConverterOptionalUInt64.readFromCursor(c) });
|
|
3982
|
+
case 21: return new P2pEvent.RelayReservationLost({relayPeerId: FfiConverterString.readFromCursor(c) });
|
|
3983
|
+
case 22: return new P2pEvent.PathEstablished({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c), path: FfiConverterTypePathKind.readFromCursor(c) });
|
|
3984
|
+
case 23: return new P2pEvent.InboundPathEstablished({peerId: FfiConverterString.readFromCursor(c), path: FfiConverterTypePathKind.readFromCursor(c), connId: FfiConverterUInt64.readFromCursor(c) });
|
|
3985
|
+
case 24: 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) });
|
|
3986
|
+
case 25: return new P2pEvent.HolePunchFailed({connectId: FfiConverterUInt64.readFromCursor(c), attempt: FfiConverterUInt32.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
3987
|
+
case 26: return new P2pEvent.ConnectFailed({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c), kind: FfiConverterTypeNatErrorKind.readFromCursor(c), detail: FfiConverterString.readFromCursor(c) });
|
|
3988
|
+
case 27: return new P2pEvent.ConnectCancelled({connectId: FfiConverterUInt64.readFromCursor(c), peerId: FfiConverterString.readFromCursor(c) });
|
|
3989
|
+
case 28: return new P2pEvent.InboundDirectUpgrade({peerId: FfiConverterString.readFromCursor(c), oldConnId: FfiConverterUInt64.readFromCursor(c), newConnId: FfiConverterUInt64.readFromCursor(c) });
|
|
3990
|
+
case 29: return new P2pEvent.Message({fromPeerId: FfiConverterString.readFromCursor(c), topics: FfiConverterSequenceString.readFromCursor(c), data: FfiConverterArrayBuffer.readFromCursor(c), seqno: FfiConverterArrayBuffer.readFromCursor(c), signed: FfiConverterBool.readFromCursor(c) });
|
|
3991
|
+
case 30: return new P2pEvent.PeerSubscribed({peerId: FfiConverterString.readFromCursor(c), topic: FfiConverterString.readFromCursor(c) });
|
|
3992
|
+
case 31: return new P2pEvent.PeerUnsubscribed({peerId: FfiConverterString.readFromCursor(c), topic: FfiConverterString.readFromCursor(c) });
|
|
3993
|
+
case 32: return new P2pEvent.GossipsubOutboundFailure({peerId: FfiConverterString.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
3994
|
+
case 33: return new P2pEvent.GossipsubProtocolViolation({peerId: FfiConverterString.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
3995
|
+
case 34: return new P2pEvent.PeerDiscovered({peerId: FfiConverterString.readFromCursor(c), addrs: FfiConverterSequenceString.readFromCursor(c), source: FfiConverterTypeDiscoverySource.readFromCursor(c) });
|
|
3996
|
+
case 35: return new P2pEvent.PeerUpdated({peerId: FfiConverterString.readFromCursor(c), addrs: FfiConverterSequenceString.readFromCursor(c), source: FfiConverterTypeDiscoverySource.readFromCursor(c) });
|
|
3997
|
+
case 36: return new P2pEvent.PeerExpired({peerId: FfiConverterString.readFromCursor(c) });
|
|
3998
|
+
case 37: return new P2pEvent.DiscoveryDialFailed({peerId: FfiConverterString.readFromCursor(c), reason: FfiConverterString.readFromCursor(c) });
|
|
3999
|
+
case 38: return new P2pEvent.MdnsFailed({kind: FfiConverterTypeMdnsFailureKind.readFromCursor(c), detail: FfiConverterString.readFromCursor(c) });
|
|
4000
|
+
case 39: return new P2pEvent.MdnsRecovered();
|
|
4001
|
+
case 40: return new P2pEvent.DiscoveryProtocolViolation({peerId: FfiConverterOptionalString.readFromCursor(c), source: FfiConverterTypeDiscoverySource.readFromCursor(c), reason: FfiConverterString.readFromCursor(c), suppressed: FfiConverterUInt32.readFromCursor(c) });
|
|
3590
4002
|
default: throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3591
4003
|
}
|
|
3592
4004
|
}
|
|
@@ -3607,22 +4019,30 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3607
4019
|
FfiConverterString.writeIntoCursor(inner.detail, c);
|
|
3608
4020
|
return;
|
|
3609
4021
|
}
|
|
3610
|
-
case P2pEvent_Tags.
|
|
4022
|
+
case P2pEvent_Tags.EndpointClosed: {
|
|
3611
4023
|
c.writeI32(3);
|
|
3612
4024
|
const inner = value.inner;
|
|
4025
|
+
FfiConverterTypeCloseOutcome.writeIntoCursor(inner.outcome, c);
|
|
4026
|
+
FfiConverterSequenceTypeUnfinishedConnection.writeIntoCursor(inner.unfinished, c);
|
|
4027
|
+
return;
|
|
4028
|
+
}
|
|
4029
|
+
case P2pEvent_Tags.ConnectionEstablished: {
|
|
4030
|
+
c.writeI32(4);
|
|
4031
|
+
const inner = value.inner;
|
|
3613
4032
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3614
4033
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
3615
4034
|
return;
|
|
3616
4035
|
}
|
|
3617
4036
|
case P2pEvent_Tags.ConnectionClosed: {
|
|
3618
|
-
c.writeI32(
|
|
4037
|
+
c.writeI32(5);
|
|
3619
4038
|
const inner = value.inner;
|
|
3620
4039
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3621
4040
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
4041
|
+
FfiConverterTypeConnectionCloseReason.writeIntoCursor(inner.reason, c);
|
|
3622
4042
|
return;
|
|
3623
4043
|
}
|
|
3624
4044
|
case P2pEvent_Tags.ConnectionReplaced: {
|
|
3625
|
-
c.writeI32(
|
|
4045
|
+
c.writeI32(6);
|
|
3626
4046
|
const inner = value.inner;
|
|
3627
4047
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3628
4048
|
FfiConverterUInt64.writeIntoCursor(inner.oldConnId, c);
|
|
@@ -3630,7 +4050,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3630
4050
|
return;
|
|
3631
4051
|
}
|
|
3632
4052
|
case P2pEvent_Tags.PeerReady: {
|
|
3633
|
-
c.writeI32(
|
|
4053
|
+
c.writeI32(7);
|
|
3634
4054
|
const inner = value.inner;
|
|
3635
4055
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3636
4056
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3638,7 +4058,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3638
4058
|
return;
|
|
3639
4059
|
}
|
|
3640
4060
|
case P2pEvent_Tags.IdentifyReceived: {
|
|
3641
|
-
c.writeI32(
|
|
4061
|
+
c.writeI32(8);
|
|
3642
4062
|
const inner = value.inner;
|
|
3643
4063
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3644
4064
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3646,7 +4066,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3646
4066
|
return;
|
|
3647
4067
|
}
|
|
3648
4068
|
case P2pEvent_Tags.PingRttMeasured: {
|
|
3649
|
-
c.writeI32(
|
|
4069
|
+
c.writeI32(9);
|
|
3650
4070
|
const inner = value.inner;
|
|
3651
4071
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3652
4072
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3654,14 +4074,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3654
4074
|
return;
|
|
3655
4075
|
}
|
|
3656
4076
|
case P2pEvent_Tags.PingTimeout: {
|
|
3657
|
-
c.writeI32(
|
|
4077
|
+
c.writeI32(10);
|
|
3658
4078
|
const inner = value.inner;
|
|
3659
4079
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3660
4080
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
3661
4081
|
return;
|
|
3662
4082
|
}
|
|
3663
4083
|
case P2pEvent_Tags.StreamReady: {
|
|
3664
|
-
c.writeI32(
|
|
4084
|
+
c.writeI32(11);
|
|
3665
4085
|
const inner = value.inner;
|
|
3666
4086
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3667
4087
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3671,7 +4091,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3671
4091
|
return;
|
|
3672
4092
|
}
|
|
3673
4093
|
case P2pEvent_Tags.StreamData: {
|
|
3674
|
-
c.writeI32(
|
|
4094
|
+
c.writeI32(12);
|
|
3675
4095
|
const inner = value.inner;
|
|
3676
4096
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3677
4097
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3680,7 +4100,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3680
4100
|
return;
|
|
3681
4101
|
}
|
|
3682
4102
|
case P2pEvent_Tags.StreamWriteAccepted: {
|
|
3683
|
-
c.writeI32(
|
|
4103
|
+
c.writeI32(13);
|
|
3684
4104
|
const inner = value.inner;
|
|
3685
4105
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3686
4106
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3688,7 +4108,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3688
4108
|
return;
|
|
3689
4109
|
}
|
|
3690
4110
|
case P2pEvent_Tags.StreamWriteStopped: {
|
|
3691
|
-
c.writeI32(
|
|
4111
|
+
c.writeI32(14);
|
|
3692
4112
|
const inner = value.inner;
|
|
3693
4113
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3694
4114
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3697,7 +4117,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3697
4117
|
return;
|
|
3698
4118
|
}
|
|
3699
4119
|
case P2pEvent_Tags.StreamRemoteWriteClosed: {
|
|
3700
|
-
c.writeI32(
|
|
4120
|
+
c.writeI32(15);
|
|
3701
4121
|
const inner = value.inner;
|
|
3702
4122
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3703
4123
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3705,7 +4125,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3705
4125
|
return;
|
|
3706
4126
|
}
|
|
3707
4127
|
case P2pEvent_Tags.StreamClosed: {
|
|
3708
|
-
c.writeI32(
|
|
4128
|
+
c.writeI32(16);
|
|
3709
4129
|
const inner = value.inner;
|
|
3710
4130
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3711
4131
|
FfiConverterUInt64.writeIntoCursor(inner.connId, c);
|
|
@@ -3713,7 +4133,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3713
4133
|
return;
|
|
3714
4134
|
}
|
|
3715
4135
|
case P2pEvent_Tags.EndpointError: {
|
|
3716
|
-
c.writeI32(
|
|
4136
|
+
c.writeI32(17);
|
|
3717
4137
|
const inner = value.inner;
|
|
3718
4138
|
FfiConverterTypeEndpointErrorKind.writeIntoCursor(inner.kind, c);
|
|
3719
4139
|
FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3723,7 +4143,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3723
4143
|
return;
|
|
3724
4144
|
}
|
|
3725
4145
|
case P2pEvent_Tags.ReachabilityChanged: {
|
|
3726
|
-
c.writeI32(
|
|
4146
|
+
c.writeI32(18);
|
|
3727
4147
|
const inner = value.inner;
|
|
3728
4148
|
FfiConverterTypeReachability.writeIntoCursor(inner.previous, c);
|
|
3729
4149
|
FfiConverterTypeReachability.writeIntoCursor(inner.current, c);
|
|
@@ -3731,26 +4151,26 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3731
4151
|
return;
|
|
3732
4152
|
}
|
|
3733
4153
|
case P2pEvent_Tags.PublicAddressesChanged: {
|
|
3734
|
-
c.writeI32(
|
|
4154
|
+
c.writeI32(19);
|
|
3735
4155
|
const inner = value.inner;
|
|
3736
4156
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
3737
4157
|
return;
|
|
3738
4158
|
}
|
|
3739
4159
|
case P2pEvent_Tags.RelayReserved: {
|
|
3740
|
-
c.writeI32(
|
|
4160
|
+
c.writeI32(20);
|
|
3741
4161
|
const inner = value.inner;
|
|
3742
4162
|
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
3743
4163
|
FfiConverterOptionalUInt64.writeIntoCursor(inner.expiresUnixSecs, c);
|
|
3744
4164
|
return;
|
|
3745
4165
|
}
|
|
3746
4166
|
case P2pEvent_Tags.RelayReservationLost: {
|
|
3747
|
-
c.writeI32(
|
|
4167
|
+
c.writeI32(21);
|
|
3748
4168
|
const inner = value.inner;
|
|
3749
4169
|
FfiConverterString.writeIntoCursor(inner.relayPeerId, c);
|
|
3750
4170
|
return;
|
|
3751
4171
|
}
|
|
3752
4172
|
case P2pEvent_Tags.PathEstablished: {
|
|
3753
|
-
c.writeI32(
|
|
4173
|
+
c.writeI32(22);
|
|
3754
4174
|
const inner = value.inner;
|
|
3755
4175
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3756
4176
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3759,7 +4179,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3759
4179
|
return;
|
|
3760
4180
|
}
|
|
3761
4181
|
case P2pEvent_Tags.InboundPathEstablished: {
|
|
3762
|
-
c.writeI32(
|
|
4182
|
+
c.writeI32(23);
|
|
3763
4183
|
const inner = value.inner;
|
|
3764
4184
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3765
4185
|
FfiConverterTypePathKind.writeIntoCursor(inner.path, c);
|
|
@@ -3767,7 +4187,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3767
4187
|
return;
|
|
3768
4188
|
}
|
|
3769
4189
|
case P2pEvent_Tags.PathUpgraded: {
|
|
3770
|
-
c.writeI32(
|
|
4190
|
+
c.writeI32(24);
|
|
3771
4191
|
const inner = value.inner;
|
|
3772
4192
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3773
4193
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3778,7 +4198,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3778
4198
|
return;
|
|
3779
4199
|
}
|
|
3780
4200
|
case P2pEvent_Tags.HolePunchFailed: {
|
|
3781
|
-
c.writeI32(
|
|
4201
|
+
c.writeI32(25);
|
|
3782
4202
|
const inner = value.inner;
|
|
3783
4203
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3784
4204
|
FfiConverterUInt32.writeIntoCursor(inner.attempt, c);
|
|
@@ -3786,7 +4206,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3786
4206
|
return;
|
|
3787
4207
|
}
|
|
3788
4208
|
case P2pEvent_Tags.ConnectFailed: {
|
|
3789
|
-
c.writeI32(
|
|
4209
|
+
c.writeI32(26);
|
|
3790
4210
|
const inner = value.inner;
|
|
3791
4211
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3792
4212
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
@@ -3795,14 +4215,14 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3795
4215
|
return;
|
|
3796
4216
|
}
|
|
3797
4217
|
case P2pEvent_Tags.ConnectCancelled: {
|
|
3798
|
-
c.writeI32(
|
|
4218
|
+
c.writeI32(27);
|
|
3799
4219
|
const inner = value.inner;
|
|
3800
4220
|
FfiConverterUInt64.writeIntoCursor(inner.connectId, c);
|
|
3801
4221
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3802
4222
|
return;
|
|
3803
4223
|
}
|
|
3804
4224
|
case P2pEvent_Tags.InboundDirectUpgrade: {
|
|
3805
|
-
c.writeI32(
|
|
4225
|
+
c.writeI32(28);
|
|
3806
4226
|
const inner = value.inner;
|
|
3807
4227
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3808
4228
|
FfiConverterUInt64.writeIntoCursor(inner.oldConnId, c);
|
|
@@ -3810,7 +4230,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3810
4230
|
return;
|
|
3811
4231
|
}
|
|
3812
4232
|
case P2pEvent_Tags.Message: {
|
|
3813
|
-
c.writeI32(
|
|
4233
|
+
c.writeI32(29);
|
|
3814
4234
|
const inner = value.inner;
|
|
3815
4235
|
FfiConverterString.writeIntoCursor(inner.fromPeerId, c);
|
|
3816
4236
|
FfiConverterSequenceString.writeIntoCursor(inner.topics, c);
|
|
@@ -3820,35 +4240,35 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3820
4240
|
return;
|
|
3821
4241
|
}
|
|
3822
4242
|
case P2pEvent_Tags.PeerSubscribed: {
|
|
3823
|
-
c.writeI32(
|
|
4243
|
+
c.writeI32(30);
|
|
3824
4244
|
const inner = value.inner;
|
|
3825
4245
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3826
4246
|
FfiConverterString.writeIntoCursor(inner.topic, c);
|
|
3827
4247
|
return;
|
|
3828
4248
|
}
|
|
3829
4249
|
case P2pEvent_Tags.PeerUnsubscribed: {
|
|
3830
|
-
c.writeI32(
|
|
4250
|
+
c.writeI32(31);
|
|
3831
4251
|
const inner = value.inner;
|
|
3832
4252
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3833
4253
|
FfiConverterString.writeIntoCursor(inner.topic, c);
|
|
3834
4254
|
return;
|
|
3835
4255
|
}
|
|
3836
4256
|
case P2pEvent_Tags.GossipsubOutboundFailure: {
|
|
3837
|
-
c.writeI32(
|
|
4257
|
+
c.writeI32(32);
|
|
3838
4258
|
const inner = value.inner;
|
|
3839
4259
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3840
4260
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
3841
4261
|
return;
|
|
3842
4262
|
}
|
|
3843
4263
|
case P2pEvent_Tags.GossipsubProtocolViolation: {
|
|
3844
|
-
c.writeI32(
|
|
4264
|
+
c.writeI32(33);
|
|
3845
4265
|
const inner = value.inner;
|
|
3846
4266
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3847
4267
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
3848
4268
|
return;
|
|
3849
4269
|
}
|
|
3850
4270
|
case P2pEvent_Tags.PeerDiscovered: {
|
|
3851
|
-
c.writeI32(
|
|
4271
|
+
c.writeI32(34);
|
|
3852
4272
|
const inner = value.inner;
|
|
3853
4273
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3854
4274
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
@@ -3856,7 +4276,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3856
4276
|
return;
|
|
3857
4277
|
}
|
|
3858
4278
|
case P2pEvent_Tags.PeerUpdated: {
|
|
3859
|
-
c.writeI32(
|
|
4279
|
+
c.writeI32(35);
|
|
3860
4280
|
const inner = value.inner;
|
|
3861
4281
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3862
4282
|
FfiConverterSequenceString.writeIntoCursor(inner.addrs, c);
|
|
@@ -3864,31 +4284,31 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3864
4284
|
return;
|
|
3865
4285
|
}
|
|
3866
4286
|
case P2pEvent_Tags.PeerExpired: {
|
|
3867
|
-
c.writeI32(
|
|
4287
|
+
c.writeI32(36);
|
|
3868
4288
|
const inner = value.inner;
|
|
3869
4289
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3870
4290
|
return;
|
|
3871
4291
|
}
|
|
3872
4292
|
case P2pEvent_Tags.DiscoveryDialFailed: {
|
|
3873
|
-
c.writeI32(
|
|
4293
|
+
c.writeI32(37);
|
|
3874
4294
|
const inner = value.inner;
|
|
3875
4295
|
FfiConverterString.writeIntoCursor(inner.peerId, c);
|
|
3876
4296
|
FfiConverterString.writeIntoCursor(inner.reason, c);
|
|
3877
4297
|
return;
|
|
3878
4298
|
}
|
|
3879
4299
|
case P2pEvent_Tags.MdnsFailed: {
|
|
3880
|
-
c.writeI32(
|
|
4300
|
+
c.writeI32(38);
|
|
3881
4301
|
const inner = value.inner;
|
|
3882
4302
|
FfiConverterTypeMdnsFailureKind.writeIntoCursor(inner.kind, c);
|
|
3883
4303
|
FfiConverterString.writeIntoCursor(inner.detail, c);
|
|
3884
4304
|
return;
|
|
3885
4305
|
}
|
|
3886
4306
|
case P2pEvent_Tags.MdnsRecovered: {
|
|
3887
|
-
c.writeI32(
|
|
4307
|
+
c.writeI32(39);
|
|
3888
4308
|
return;
|
|
3889
4309
|
}
|
|
3890
4310
|
case P2pEvent_Tags.DiscoveryProtocolViolation: {
|
|
3891
|
-
c.writeI32(
|
|
4311
|
+
c.writeI32(40);
|
|
3892
4312
|
const inner = value.inner;
|
|
3893
4313
|
FfiConverterOptionalString.writeIntoCursor(inner.peerId, c);
|
|
3894
4314
|
FfiConverterTypeDiscoverySource.writeIntoCursor(inner.source, c);
|
|
@@ -3918,6 +4338,13 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3918
4338
|
size += FfiConverterString.allocationSize(inner.detail);
|
|
3919
4339
|
return size;
|
|
3920
4340
|
}
|
|
4341
|
+
case P2pEvent_Tags.EndpointClosed: {
|
|
4342
|
+
const inner = value.inner;
|
|
4343
|
+
let size = 4;
|
|
4344
|
+
size += FfiConverterTypeCloseOutcome.allocationSize(inner.outcome);
|
|
4345
|
+
size += FfiConverterSequenceTypeUnfinishedConnection.allocationSize(inner.unfinished);
|
|
4346
|
+
return size;
|
|
4347
|
+
}
|
|
3921
4348
|
case P2pEvent_Tags.ConnectionEstablished: {
|
|
3922
4349
|
const inner = value.inner;
|
|
3923
4350
|
let size = 4;
|
|
@@ -3930,6 +4357,7 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
3930
4357
|
let size = 4;
|
|
3931
4358
|
size += FfiConverterString.allocationSize(inner.peerId);
|
|
3932
4359
|
size += FfiConverterUInt64.allocationSize(inner.connId);
|
|
4360
|
+
size += FfiConverterTypeConnectionCloseReason.allocationSize(inner.reason);
|
|
3933
4361
|
return size;
|
|
3934
4362
|
}
|
|
3935
4363
|
case P2pEvent_Tags.ConnectionReplaced: {
|
|
@@ -4213,15 +4641,15 @@ const FfiConverterTypeP2pEvent = (() => {
|
|
|
4213
4641
|
return new FFIConverter();
|
|
4214
4642
|
})();
|
|
4215
4643
|
|
|
4216
|
-
// FfiConverter for string | undefined
|
|
4217
|
-
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
4218
|
-
|
|
4219
4644
|
// FfiConverter for Array<string>
|
|
4220
4645
|
const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
|
|
4221
4646
|
|
|
4222
4647
|
// FfiConverter for Array<string> | undefined
|
|
4223
4648
|
const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);
|
|
4224
4649
|
|
|
4650
|
+
// FfiConverter for string | undefined
|
|
4651
|
+
const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
4652
|
+
|
|
4225
4653
|
// FfiConverter for DiscoveryOptions | undefined
|
|
4226
4654
|
const FfiConverterOptionalTypeDiscoveryOptions = new FfiConverterOptional(FfiConverterTypeDiscoveryOptions);
|
|
4227
4655
|
|
|
@@ -4237,6 +4665,9 @@ const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
|
|
|
4237
4665
|
// FfiConverter for Array<bigint>
|
|
4238
4666
|
const FfiConverterSequenceUInt64 = new FfiConverterArray(FfiConverterUInt64);
|
|
4239
4667
|
|
|
4668
|
+
// FfiConverter for Array<UnfinishedConnection>
|
|
4669
|
+
const FfiConverterSequenceTypeUnfinishedConnection = new FfiConverterArray(FfiConverterTypeUnfinishedConnection);
|
|
4670
|
+
|
|
4240
4671
|
|
|
4241
4672
|
/**
|
|
4242
4673
|
* This should be called before anything else.
|
|
@@ -4262,8 +4693,10 @@ function uniffiEnsureInitialized() {
|
|
|
4262
4693
|
export default Object.freeze({
|
|
4263
4694
|
initialize: uniffiEnsureInitialized,
|
|
4264
4695
|
converters: {
|
|
4696
|
+
FfiConverterTypeCloseOutcome,
|
|
4265
4697
|
FfiConverterTypeConfigCapability,
|
|
4266
4698
|
FfiConverterTypeConnectTarget,
|
|
4699
|
+
FfiConverterTypeConnectionCloseReason,
|
|
4267
4700
|
FfiConverterTypeConnectionInfo,
|
|
4268
4701
|
FfiConverterTypeDiscoveryOptions,
|
|
4269
4702
|
FfiConverterTypeDiscoverySource,
|
|
@@ -4281,5 +4714,6 @@ export default Object.freeze({
|
|
|
4281
4714
|
FfiConverterTypePathKind,
|
|
4282
4715
|
FfiConverterTypeReachability,
|
|
4283
4716
|
FfiConverterTypeRelayReservationInfo,
|
|
4717
|
+
FfiConverterTypeUnfinishedConnection,
|
|
4284
4718
|
}
|
|
4285
4719
|
});
|