@@ -14,15 +14,15 @@ private extension RustBuffer {
14
14
// Allocate a new buffer, copying the contents of a `UInt8` array.
15
15
init ( bytes: [ UInt8 ] ) {
16
16
let rbuf = bytes. withUnsafeBufferPointer { ptr in
17
- try ! rustCall { ffi_push_b1b4_rustbuffer_from_bytes ( ForeignBytes ( bufferPointer: ptr) , $0) }
17
+ try ! rustCall { ffi_push_6d2f_rustbuffer_from_bytes ( ForeignBytes ( bufferPointer: ptr) , $0) }
18
18
}
19
19
self . init ( capacity: rbuf. capacity, len: rbuf. len, data: rbuf. data)
20
20
}
21
21
22
22
// Frees the buffer in place.
23
23
// The buffer must not be used after this is called.
24
24
func deallocate( ) {
25
- try ! rustCall { ffi_push_b1b4_rustbuffer_free ( self , $0) }
25
+ try ! rustCall { ffi_push_6d2f_rustbuffer_free ( self , $0) }
26
26
}
27
27
}
28
28
@@ -273,7 +273,7 @@ extension String: ViaFfi {
273
273
274
274
fileprivate static func lift( _ v: FfiType ) throws -> Self {
275
275
defer {
276
- try ! rustCall { ffi_push_b1b4_rustbuffer_free ( v, $0) }
276
+ try ! rustCall { ffi_push_6d2f_rustbuffer_free ( v, $0) }
277
277
}
278
278
if v. data == nil {
279
279
return String ( )
@@ -289,7 +289,7 @@ extension String: ViaFfi {
289
289
// The swift string gives us a trailing null byte, we don't want it.
290
290
let buf = UnsafeBufferPointer ( rebasing: ptr. prefix ( upTo: ptr. count - 1 ) )
291
291
let bytes = ForeignBytes ( bufferPointer: buf)
292
- return try ! rustCall { ffi_push_b1b4_rustbuffer_from_bytes ( bytes, $0) }
292
+ return try ! rustCall { ffi_push_6d2f_rustbuffer_from_bytes ( bytes, $0) }
293
293
}
294
294
}
295
295
}
@@ -598,15 +598,13 @@ private func makeRustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>)
598
598
}
599
599
600
600
public struct DispatchInfo {
601
- public var uaid : String
602
601
public var scope : String
603
602
public var endpoint : String
604
603
public var appServerKey : String ?
605
604
606
605
// Default memberwise initializers are never public by default, so we
607
606
// declare one manually.
608
- public init ( uaid: String , scope: String , endpoint: String , appServerKey: String ? ) {
609
- self . uaid = uaid
607
+ public init ( scope: String , endpoint: String , appServerKey: String ? ) {
610
608
self . scope = scope
611
609
self . endpoint = endpoint
612
610
self . appServerKey = appServerKey
@@ -615,9 +613,6 @@ public struct DispatchInfo {
615
613
616
614
extension DispatchInfo : Equatable , Hashable {
617
615
public static func == ( lhs: DispatchInfo , rhs: DispatchInfo ) -> Bool {
618
- if lhs. uaid != rhs. uaid {
619
- return false
620
- }
621
616
if lhs. scope != rhs. scope {
622
617
return false
623
618
}
@@ -631,7 +626,6 @@ extension DispatchInfo: Equatable, Hashable {
631
626
}
632
627
633
628
public func hash( into hasher: inout Hasher ) {
634
- hasher. combine ( uaid)
635
629
hasher. combine ( scope)
636
630
hasher. combine ( endpoint)
637
631
hasher. combine ( appServerKey)
@@ -641,15 +635,13 @@ extension DispatchInfo: Equatable, Hashable {
641
635
private extension DispatchInfo {
642
636
static func read( from buf: Reader ) throws -> DispatchInfo {
643
637
return try DispatchInfo (
644
- uaid: String . read ( from: buf) ,
645
638
scope: String . read ( from: buf) ,
646
639
endpoint: String . read ( from: buf) ,
647
640
appServerKey: String ? . read ( from: buf)
648
641
)
649
642
}
650
643
651
644
func write( into buf: Writer ) {
652
- uaid. write ( into: buf)
653
645
scope. write ( into: buf)
654
646
endpoint. write ( into: buf)
655
647
appServerKey. write ( into: buf)
@@ -858,69 +850,69 @@ public class PushManager: PushManagerProtocol {
858
850
self . pointer = pointer
859
851
}
860
852
861
- public convenience init ( senderId: String , serverHost: String = " updates.push.services.mozilla.com " , httpProtocol: String = " https " , bridgeType: BridgeType , registrationId: String , databasePath: String = " push.sqlite " ) throws {
853
+ public convenience init ( senderId: String , serverHost: String = " updates.push.services.mozilla.com " , httpProtocol: String = " https " , bridgeType: BridgeType , registrationId: String = " " , databasePath: String = " push.sqlite " ) throws {
862
854
self . init ( unsafeFromRawPointer: try
863
855
864
856
rustCallWithError ( PushError . self) {
865
- push_b1b4_PushManager_new ( senderId. lower ( ) , serverHost. lower ( ) , httpProtocol. lower ( ) , bridgeType. lower ( ) , registrationId. lower ( ) , databasePath. lower ( ) , $0)
857
+ push_6d2f_PushManager_new ( senderId. lower ( ) , serverHost. lower ( ) , httpProtocol. lower ( ) , bridgeType. lower ( ) , registrationId. lower ( ) , databasePath. lower ( ) , $0)
866
858
} )
867
859
}
868
860
869
861
deinit {
870
- try ! rustCall { ffi_push_b1b4_PushManager_object_free ( pointer, $0) }
862
+ try ! rustCall { ffi_push_6d2f_PushManager_object_free ( pointer, $0) }
871
863
}
872
864
873
865
public func subscribe( channelId: String = " " , scope: String = " " , appServerSey: String ? = nil ) throws -> SubscriptionResponse {
874
866
let _retval = try
875
867
rustCallWithError ( PushError . self) {
876
- push_b1b4_PushManager_subscribe ( self . pointer, channelId. lower ( ) , scope. lower ( ) , appServerSey. lower ( ) , $0)
868
+ push_6d2f_PushManager_subscribe ( self . pointer, channelId. lower ( ) , scope. lower ( ) , appServerSey. lower ( ) , $0)
877
869
}
878
870
return try SubscriptionResponse . lift ( _retval)
879
871
}
880
872
881
873
public func unsubscribe( channelId: String ) throws -> Bool {
882
874
let _retval = try
883
875
rustCallWithError ( PushError . self) {
884
- push_b1b4_PushManager_unsubscribe ( self . pointer, channelId. lower ( ) , $0)
876
+ push_6d2f_PushManager_unsubscribe ( self . pointer, channelId. lower ( ) , $0)
885
877
}
886
878
return try Bool . lift ( _retval)
887
879
}
888
880
889
881
public func unsubscribeAll( ) throws {
890
882
try
891
883
rustCallWithError ( PushError . self) {
892
- push_b1b4_PushManager_unsubscribe_all ( self . pointer, $0)
884
+ push_6d2f_PushManager_unsubscribe_all ( self . pointer, $0)
893
885
}
894
886
}
895
887
896
888
public func update( registrationToken: String ) throws -> Bool {
897
889
let _retval = try
898
890
rustCallWithError ( PushError . self) {
899
- push_b1b4_PushManager_update ( self . pointer, registrationToken. lower ( ) , $0)
891
+ push_6d2f_PushManager_update ( self . pointer, registrationToken. lower ( ) , $0)
900
892
}
901
893
return try Bool . lift ( _retval)
902
894
}
903
895
904
896
public func verifyConnection( ) throws -> [ PushSubscriptionChanged ] {
905
897
let _retval = try
906
898
rustCallWithError ( PushError . self) {
907
- push_b1b4_PushManager_verify_connection ( self . pointer, $0)
899
+ push_6d2f_PushManager_verify_connection ( self . pointer, $0)
908
900
}
909
901
return try [ PushSubscriptionChanged ] . lift ( _retval)
910
902
}
911
903
912
904
public func decrypt( channelId: String , body: String , encoding: String = " aes128gcm " , salt: String = " " , dh: String = " " ) throws -> [ Int8 ] {
913
905
let _retval = try
914
906
rustCallWithError ( PushError . self) {
915
- push_b1b4_PushManager_decrypt ( self . pointer, channelId. lower ( ) , body. lower ( ) , encoding. lower ( ) , salt. lower ( ) , dh. lower ( ) , $0)
907
+ push_6d2f_PushManager_decrypt ( self . pointer, channelId. lower ( ) , body. lower ( ) , encoding. lower ( ) , salt. lower ( ) , dh. lower ( ) , $0)
916
908
}
917
909
return try [ Int8 ] . lift ( _retval)
918
910
}
919
911
920
912
public func dispatchInfoForChid( channelId: String ) throws -> DispatchInfo ? {
921
913
let _retval = try
922
914
rustCallWithError ( PushError . self) {
923
- push_b1b4_PushManager_dispatch_info_for_chid ( self . pointer, channelId. lower ( ) , $0)
915
+ push_6d2f_PushManager_dispatch_info_for_chid ( self . pointer, channelId. lower ( ) , $0)
924
916
}
925
917
return try DispatchInfo ? . lift ( _retval)
926
918
}
0 commit comments