Skip to content

Commit

Permalink
Merge pull request #49 from xmtp/np/updates-rust-sql-bindings
Browse files Browse the repository at this point in the history
Updates rust sql bindings
  • Loading branch information
nplasterer authored Jul 19, 2024
2 parents fc7f470 + c1620ef commit b9012ce
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 27 deletions.
4 changes: 2 additions & 2 deletions LibXMTP.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'LibXMTP'
s.version = '0.5.5-beta2'
s.version = '0.5.6-beta0'
s.summary = 'XMTP shared Rust code that powers cross-platform SDKs'

s.homepage = 'https://github.com/xmtp/libxmtp-swift'
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.platform = :ios, '14.0', :macos, '11.0'
s.swift_version = '5.3'

s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-2de056e/LibXMTPSwiftFFI.zip", :type => :zip }
s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-9698552/LibXMTPSwiftFFI.zip", :type => :zip }
s.vendored_frameworks = 'LibXMTPSwiftFFI.xcframework'
s.source_files = 'Sources/LibXMTP/**/*'
end
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ let package = Package(
),
.binaryTarget(
name: "LibXMTPSwiftFFI",
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-2de056e/LibXMTPSwiftFFI.zip",
checksum: "f66556c05d27936bc5a9b9d5ba997fd8fb61299697c809d3030df5f9667ad96c"
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-9698552/LibXMTPSwiftFFI.zip",
checksum: "114b0d8d2787b4f24bc89f977bc08fc4395a7f6d6b7cc7d9dcd0318bd0891b8f"
),
.testTarget(name: "LibXMTPTests", dependencies: ["LibXMTP"]),
]
Expand Down
4 changes: 2 additions & 2 deletions Sources/LibXMTP/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: ae41dcc7
Version: d1cd7939
Branch: main
Date: 2024-07-18 22:09:58 +0000
Date: 2024-07-19 21:33:48 +0000
72 changes: 51 additions & 21 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,9 @@ public protocol FfiConversationsProtocol: AnyObject {

func processStreamedWelcomeMessage(envelopeBytes: Data) async throws -> FfiGroup

func stream(callback: FfiConversationCallback) -> FfiStreamCloser
func stream(callback: FfiConversationCallback) async -> FfiStreamCloser

func streamAllMessages(messageCallback: FfiMessageCallback) -> FfiStreamCloser
func streamAllMessages(messageCallback: FfiMessageCallback) async -> FfiStreamCloser

func sync() async throws
}
Expand Down Expand Up @@ -611,18 +611,38 @@ open class FfiConversations:
)
}

open func stream(callback: FfiConversationCallback) -> FfiStreamCloser {
return try! FfiConverterTypeFfiStreamCloser.lift(try! rustCall {
uniffi_xmtpv3_fn_method_fficonversations_stream(self.uniffiClonePointer(),
FfiConverterCallbackInterfaceFfiConversationCallback.lower(callback), $0)
})
open func stream(callback: FfiConversationCallback) async -> FfiStreamCloser {
return
try! await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_method_fficonversations_stream(
self.uniffiClonePointer(),
FfiConverterCallbackInterfaceFfiConversationCallback.lower(callback)
)
},
pollFunc: ffi_xmtpv3_rust_future_poll_pointer,
completeFunc: ffi_xmtpv3_rust_future_complete_pointer,
freeFunc: ffi_xmtpv3_rust_future_free_pointer,
liftFunc: FfiConverterTypeFfiStreamCloser.lift,
errorHandler: nil
)
}

open func streamAllMessages(messageCallback: FfiMessageCallback) -> FfiStreamCloser {
return try! FfiConverterTypeFfiStreamCloser.lift(try! rustCall {
uniffi_xmtpv3_fn_method_fficonversations_stream_all_messages(self.uniffiClonePointer(),
FfiConverterCallbackInterfaceFfiMessageCallback.lower(messageCallback), $0)
})
open func streamAllMessages(messageCallback: FfiMessageCallback) async -> FfiStreamCloser {
return
try! await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_method_fficonversations_stream_all_messages(
self.uniffiClonePointer(),
FfiConverterCallbackInterfaceFfiMessageCallback.lower(messageCallback)
)
},
pollFunc: ffi_xmtpv3_rust_future_poll_pointer,
completeFunc: ffi_xmtpv3_rust_future_complete_pointer,
freeFunc: ffi_xmtpv3_rust_future_free_pointer,
liftFunc: FfiConverterTypeFfiStreamCloser.lift,
errorHandler: nil
)
}

open func sync() async throws {
Expand Down Expand Up @@ -741,7 +761,7 @@ public protocol FfiGroupProtocol: AnyObject {
*/
func sendOptimistic(contentBytes: Data) throws -> Data

func stream(messageCallback: FfiMessageCallback) -> FfiStreamCloser
func stream(messageCallback: FfiMessageCallback) async -> FfiStreamCloser

func superAdminList() throws -> [String]

Expand Down Expand Up @@ -1090,11 +1110,21 @@ open class FfiGroup:
})
}

open func stream(messageCallback: FfiMessageCallback) -> FfiStreamCloser {
return try! FfiConverterTypeFfiStreamCloser.lift(try! rustCall {
uniffi_xmtpv3_fn_method_ffigroup_stream(self.uniffiClonePointer(),
FfiConverterCallbackInterfaceFfiMessageCallback.lower(messageCallback), $0)
})
open func stream(messageCallback: FfiMessageCallback) async -> FfiStreamCloser {
return
try! await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_method_ffigroup_stream(
self.uniffiClonePointer(),
FfiConverterCallbackInterfaceFfiMessageCallback.lower(messageCallback)
)
},
pollFunc: ffi_xmtpv3_rust_future_poll_pointer,
completeFunc: ffi_xmtpv3_rust_future_complete_pointer,
freeFunc: ffi_xmtpv3_rust_future_free_pointer,
liftFunc: FfiConverterTypeFfiStreamCloser.lift,
errorHandler: nil
)
}

open func superAdminList() throws -> [String] {
Expand Down Expand Up @@ -4939,10 +4969,10 @@ private var initializationResult: InitializationResult {
if uniffi_xmtpv3_checksum_method_fficonversations_process_streamed_welcome_message() != 15283 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversations_stream() != 873 {
if uniffi_xmtpv3_checksum_method_fficonversations_stream() != 3079 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages() != 48407 {
if uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages() != 13204 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversations_sync() != 9054 {
Expand Down Expand Up @@ -5029,7 +5059,7 @@ private var initializationResult: InitializationResult {
if uniffi_xmtpv3_checksum_method_ffigroup_send_optimistic() != 13872 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffigroup_stream() != 44144 {
if uniffi_xmtpv3_checksum_method_ffigroup_stream() != 34669 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffigroup_super_admin_list() != 5323 {
Expand Down

0 comments on commit b9012ce

Please sign in to comment.