@@ -427,6 +427,22 @@ fileprivate struct FfiConverterInt64: FfiConverterPrimitive {
427
427
}
428
428
}
429
429
430
+ #if swift(>=5.8)
431
+ @_documentation ( visibility: private)
432
+ #endif
433
+ fileprivate struct FfiConverterDouble : FfiConverterPrimitive {
434
+ typealias FfiType = Double
435
+ typealias SwiftType = Double
436
+
437
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> Double {
438
+ return try lift ( readDouble ( & buf) )
439
+ }
440
+
441
+ public static func write( _ value: Double , into buf: inout [ UInt8 ] ) {
442
+ writeDouble ( & buf, lower ( value) )
443
+ }
444
+ }
445
+
430
446
#if swift(>=5.8)
431
447
@_documentation ( visibility: private)
432
448
#endif
@@ -1382,8 +1398,12 @@ public func FfiConverterTypeNimbusTargetingHelper_lower(_ value: NimbusTargeting
1382
1398
1383
1399
public protocol RecordedContext : AnyObject {
1384
1400
1401
+ func getEventQueries( ) -> [ String : String ]
1402
+
1385
1403
func record( )
1386
1404
1405
+ func setEventQueryValues( eventQueryValues: [ String : Double ] )
1406
+
1387
1407
func toJson( ) -> JsonObject
1388
1408
1389
1409
}
@@ -1437,12 +1457,26 @@ open class RecordedContextImpl:
1437
1457
1438
1458
1439
1459
1460
+ open func getEventQueries( ) -> [ String : String ] {
1461
+ return try ! FfiConverterDictionaryStringString . lift ( try ! rustCall ( ) {
1462
+ uniffi_nimbus_fn_method_recordedcontext_get_event_queries ( self . uniffiClonePointer ( ) , $0
1463
+ )
1464
+ } )
1465
+ }
1466
+
1440
1467
open func record( ) { try ! rustCall ( ) {
1441
1468
uniffi_nimbus_fn_method_recordedcontext_record ( self . uniffiClonePointer ( ) , $0
1442
1469
)
1443
1470
}
1444
1471
}
1445
1472
1473
+ open func setEventQueryValues( eventQueryValues: [ String : Double ] ) { try ! rustCall ( ) {
1474
+ uniffi_nimbus_fn_method_recordedcontext_set_event_query_values ( self . uniffiClonePointer ( ) ,
1475
+ FfiConverterDictionaryStringDouble . lower ( eventQueryValues) , $0
1476
+ )
1477
+ }
1478
+ }
1479
+
1446
1480
open func toJson( ) -> JsonObject {
1447
1481
return try ! FfiConverterTypeJsonObject . lift ( try ! rustCall ( ) {
1448
1482
uniffi_nimbus_fn_method_recordedcontext_to_json ( self . uniffiClonePointer ( ) , $0
@@ -1466,6 +1500,28 @@ fileprivate struct UniffiCallbackInterfaceRecordedContext {
1466
1500
// Create the VTable using a series of closures.
1467
1501
// Swift automatically converts these into C callback functions.
1468
1502
static var vtable : UniffiVTableCallbackInterfaceRecordedContext = UniffiVTableCallbackInterfaceRecordedContext (
1503
+ getEventQueries: { (
1504
+ uniffiHandle: UInt64 ,
1505
+ uniffiOutReturn: UnsafeMutablePointer < RustBuffer > ,
1506
+ uniffiCallStatus: UnsafeMutablePointer < RustCallStatus >
1507
+ ) in
1508
+ let makeCall = {
1509
+ ( ) throws -> [ String : String ] in
1510
+ guard let uniffiObj = try ? FfiConverterTypeRecordedContext . handleMap. get ( handle: uniffiHandle) else {
1511
+ throw UniffiInternalError . unexpectedStaleHandle
1512
+ }
1513
+ return uniffiObj. getEventQueries (
1514
+ )
1515
+ }
1516
+
1517
+
1518
+ let writeReturn = { uniffiOutReturn. pointee = FfiConverterDictionaryStringString . lower ( $0) }
1519
+ uniffiTraitInterfaceCall (
1520
+ callStatus: uniffiCallStatus,
1521
+ makeCall: makeCall,
1522
+ writeReturn: writeReturn
1523
+ )
1524
+ } ,
1469
1525
record: { (
1470
1526
uniffiHandle: UInt64 ,
1471
1527
uniffiOutReturn: UnsafeMutableRawPointer ,
@@ -1481,6 +1537,30 @@ fileprivate struct UniffiCallbackInterfaceRecordedContext {
1481
1537
}
1482
1538
1483
1539
1540
+ let writeReturn = { ( ) }
1541
+ uniffiTraitInterfaceCall (
1542
+ callStatus: uniffiCallStatus,
1543
+ makeCall: makeCall,
1544
+ writeReturn: writeReturn
1545
+ )
1546
+ } ,
1547
+ setEventQueryValues: { (
1548
+ uniffiHandle: UInt64 ,
1549
+ eventQueryValues: RustBuffer ,
1550
+ uniffiOutReturn: UnsafeMutableRawPointer ,
1551
+ uniffiCallStatus: UnsafeMutablePointer < RustCallStatus >
1552
+ ) in
1553
+ let makeCall = {
1554
+ ( ) throws -> ( ) in
1555
+ guard let uniffiObj = try ? FfiConverterTypeRecordedContext . handleMap. get ( handle: uniffiHandle) else {
1556
+ throw UniffiInternalError . unexpectedStaleHandle
1557
+ }
1558
+ return uniffiObj. setEventQueryValues (
1559
+ eventQueryValues: try FfiConverterDictionaryStringDouble . lift ( eventQueryValues)
1560
+ )
1561
+ }
1562
+
1563
+
1484
1564
let writeReturn = { ( ) }
1485
1565
uniffiTraitInterfaceCall (
1486
1566
callStatus: uniffiCallStatus,
@@ -2478,6 +2558,8 @@ public enum NimbusError {
2478
2558
2479
2559
case UniFfiCallbackError( message: String )
2480
2560
2561
+ case RegexError( message: String )
2562
+
2481
2563
}
2482
2564
2483
2565
@@ -2594,6 +2676,10 @@ public struct FfiConverterTypeNimbusError: FfiConverterRustBuffer {
2594
2676
message: try FfiConverterString . read ( from: & buf)
2595
2677
)
2596
2678
2679
+ case 26 : return . RegexError(
2680
+ message: try FfiConverterString . read ( from: & buf)
2681
+ )
2682
+
2597
2683
2598
2684
default : throw UniffiInternalError . unexpectedEnumCase
2599
2685
}
@@ -2655,6 +2741,8 @@ public struct FfiConverterTypeNimbusError: FfiConverterRustBuffer {
2655
2741
writeInt ( & buf, Int32 ( 24 ) )
2656
2742
case . UniFfiCallbackError( _ /* message is ignored*/) :
2657
2743
writeInt ( & buf, Int32 ( 25 ) )
2744
+ case . RegexError( _ /* message is ignored*/) :
2745
+ writeInt ( & buf, Int32 ( 26 ) )
2658
2746
2659
2747
2660
2748
}
@@ -3120,6 +3208,58 @@ fileprivate struct FfiConverterSequenceTypeExperimentBranch: FfiConverterRustBuf
3120
3208
}
3121
3209
}
3122
3210
3211
+ #if swift(>=5.8)
3212
+ @_documentation ( visibility: private)
3213
+ #endif
3214
+ fileprivate struct FfiConverterDictionaryStringDouble : FfiConverterRustBuffer {
3215
+ public static func write( _ value: [ String : Double ] , into buf: inout [ UInt8 ] ) {
3216
+ let len = Int32 ( value. count)
3217
+ writeInt ( & buf, len)
3218
+ for (key, value) in value {
3219
+ FfiConverterString . write ( key, into: & buf)
3220
+ FfiConverterDouble . write ( value, into: & buf)
3221
+ }
3222
+ }
3223
+
3224
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> [ String : Double ] {
3225
+ let len : Int32 = try readInt ( & buf)
3226
+ var dict = [ String: Double] ( )
3227
+ dict. reserveCapacity ( Int ( len) )
3228
+ for _ in 0 ..< len {
3229
+ let key = try FfiConverterString . read ( from: & buf)
3230
+ let value = try FfiConverterDouble . read ( from: & buf)
3231
+ dict [ key] = value
3232
+ }
3233
+ return dict
3234
+ }
3235
+ }
3236
+
3237
+ #if swift(>=5.8)
3238
+ @_documentation ( visibility: private)
3239
+ #endif
3240
+ fileprivate struct FfiConverterDictionaryStringString : FfiConverterRustBuffer {
3241
+ public static func write( _ value: [ String : String ] , into buf: inout [ UInt8 ] ) {
3242
+ let len = Int32 ( value. count)
3243
+ writeInt ( & buf, len)
3244
+ for (key, value) in value {
3245
+ FfiConverterString . write ( key, into: & buf)
3246
+ FfiConverterString . write ( value, into: & buf)
3247
+ }
3248
+ }
3249
+
3250
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> [ String : String ] {
3251
+ let len : Int32 = try readInt ( & buf)
3252
+ var dict = [ String: String] ( )
3253
+ dict. reserveCapacity ( Int ( len) )
3254
+ for _ in 0 ..< len {
3255
+ let key = try FfiConverterString . read ( from: & buf)
3256
+ let value = try FfiConverterString . read ( from: & buf)
3257
+ dict [ key] = value
3258
+ }
3259
+ return dict
3260
+ }
3261
+ }
3262
+
3123
3263
3124
3264
3125
3265
@@ -3164,6 +3304,17 @@ public func FfiConverterTypeJsonObject_lift(_ value: RustBuffer) throws -> JsonO
3164
3304
public func FfiConverterTypeJsonObject_lower( _ value: JsonObject ) -> RustBuffer {
3165
3305
return FfiConverterTypeJsonObject . lower ( value)
3166
3306
}
3307
+ /**
3308
+ * A test utility used to validate event queries against the jexl evaluator.
3309
+ *
3310
+ * This method should only be used in tests.
3311
+ */
3312
+ public func validateEventQueries( recordedContext: RecordedContext ) throws { try rustCallWithError ( FfiConverterTypeNimbusError . lift) {
3313
+ uniffi_nimbus_fn_func_validate_event_queries (
3314
+ FfiConverterTypeRecordedContext . lower ( recordedContext) , $0
3315
+ )
3316
+ }
3317
+ }
3167
3318
3168
3319
private enum InitializationResult {
3169
3320
case ok
@@ -3180,6 +3331,9 @@ private var initializationResult: InitializationResult = {
3180
3331
if bindings_contract_version != scaffolding_contract_version {
3181
3332
return InitializationResult . contractVersionMismatch
3182
3333
}
3334
+ if ( uniffi_nimbus_checksum_func_validate_event_queries ( ) != 42746 ) {
3335
+ return InitializationResult . apiChecksumMismatch
3336
+ }
3183
3337
if ( uniffi_nimbus_checksum_method_nimbusclient_advance_event_time ( ) != 40755 ) {
3184
3338
return InitializationResult . apiChecksumMismatch
3185
3339
}
@@ -3267,9 +3421,15 @@ private var initializationResult: InitializationResult = {
3267
3421
if ( uniffi_nimbus_checksum_method_nimbustargetinghelper_eval_jexl ( ) != 42395 ) {
3268
3422
return InitializationResult . apiChecksumMismatch
3269
3423
}
3424
+ if ( uniffi_nimbus_checksum_method_recordedcontext_get_event_queries ( ) != 28844 ) {
3425
+ return InitializationResult . apiChecksumMismatch
3426
+ }
3270
3427
if ( uniffi_nimbus_checksum_method_recordedcontext_record ( ) != 5916 ) {
3271
3428
return InitializationResult . apiChecksumMismatch
3272
3429
}
3430
+ if ( uniffi_nimbus_checksum_method_recordedcontext_set_event_query_values ( ) != 40199 ) {
3431
+ return InitializationResult . apiChecksumMismatch
3432
+ }
3273
3433
if ( uniffi_nimbus_checksum_method_recordedcontext_to_json ( ) != 530 ) {
3274
3434
return InitializationResult . apiChecksumMismatch
3275
3435
}
0 commit comments