@@ -5201,7 +5201,9 @@ public func FfiConverterTypeSshClient_lower(_ value: SshClient) -> UnsafeMutable
52015201
52025202public protocol StateClientProtocol : AnyObject , Sendable {
52035203
5204- func registerCipherRepository( store: CipherRepository )
5204+ func initializeState( configuration: SqliteConfiguration ) async throws
5205+
5206+ func registerCipherRepository( repository: CipherRepository )
52055207
52065208}
52075209open class StateClient : StateClientProtocol , @unchecked Sendable {
@@ -5256,9 +5258,26 @@ open class StateClient: StateClientProtocol, @unchecked Sendable {
52565258
52575259
52585260
5259- open func registerCipherRepository( store: CipherRepository ) { try ! rustCall ( ) {
5261+ open func initializeState( configuration: SqliteConfiguration ) async throws {
5262+ return
5263+ try await uniffiRustCallAsync (
5264+ rustFutureFunc: {
5265+ uniffi_bitwarden_uniffi_fn_method_stateclient_initialize_state (
5266+ self . uniffiClonePointer ( ) ,
5267+ FfiConverterTypeSqliteConfiguration_lower ( configuration)
5268+ )
5269+ } ,
5270+ pollFunc: ffi_bitwarden_uniffi_rust_future_poll_void,
5271+ completeFunc: ffi_bitwarden_uniffi_rust_future_complete_void,
5272+ freeFunc: ffi_bitwarden_uniffi_rust_future_free_void,
5273+ liftFunc: { $0 } ,
5274+ errorHandler: FfiConverterTypeBitwardenError_lift
5275+ )
5276+ }
5277+
5278+ open func registerCipherRepository( repository: CipherRepository ) { try ! rustCall ( ) {
52605279 uniffi_bitwarden_uniffi_fn_method_stateclient_register_cipher_repository ( self . uniffiClonePointer ( ) ,
5261- FfiConverterTypeCipherRepository_lower ( store ) , $0
5280+ FfiConverterTypeCipherRepository_lower ( repository ) , $0
52625281 )
52635282}
52645283}
@@ -5753,6 +5772,76 @@ public func FfiConverterTypeCipherViewWrapper_lower(_ value: CipherViewWrapper)
57535772}
57545773
57555774
5775+ public struct SqliteConfiguration {
5776+ public let dbName : String
5777+ public let folderPath : String
5778+
5779+ // Default memberwise initializers are never public by default, so we
5780+ // declare one manually.
5781+ public init ( dbName: String , folderPath: String ) {
5782+ self . dbName = dbName
5783+ self . folderPath = folderPath
5784+ }
5785+ }
5786+
5787+ #if compiler(>=6)
5788+ extension SqliteConfiguration : Sendable { }
5789+ #endif
5790+
5791+
5792+ extension SqliteConfiguration : Equatable , Hashable {
5793+ public static func == ( lhs: SqliteConfiguration , rhs: SqliteConfiguration ) -> Bool {
5794+ if lhs. dbName != rhs. dbName {
5795+ return false
5796+ }
5797+ if lhs. folderPath != rhs. folderPath {
5798+ return false
5799+ }
5800+ return true
5801+ }
5802+
5803+ public func hash( into hasher: inout Hasher ) {
5804+ hasher. combine ( dbName)
5805+ hasher. combine ( folderPath)
5806+ }
5807+ }
5808+
5809+
5810+
5811+ #if swift(>=5.8)
5812+ @_documentation ( visibility: private)
5813+ #endif
5814+ public struct FfiConverterTypeSqliteConfiguration : FfiConverterRustBuffer {
5815+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SqliteConfiguration {
5816+ return
5817+ try SqliteConfiguration (
5818+ dbName: FfiConverterString . read ( from: & buf) ,
5819+ folderPath: FfiConverterString . read ( from: & buf)
5820+ )
5821+ }
5822+
5823+ public static func write( _ value: SqliteConfiguration , into buf: inout [ UInt8 ] ) {
5824+ FfiConverterString . write ( value. dbName, into: & buf)
5825+ FfiConverterString . write ( value. folderPath, into: & buf)
5826+ }
5827+ }
5828+
5829+
5830+ #if swift(>=5.8)
5831+ @_documentation ( visibility: private)
5832+ #endif
5833+ public func FfiConverterTypeSqliteConfiguration_lift( _ buf: RustBuffer ) throws -> SqliteConfiguration {
5834+ return try FfiConverterTypeSqliteConfiguration . lift ( buf)
5835+ }
5836+
5837+ #if swift(>=5.8)
5838+ @_documentation ( visibility: private)
5839+ #endif
5840+ public func FfiConverterTypeSqliteConfiguration_lower( _ value: SqliteConfiguration ) -> RustBuffer {
5841+ return FfiConverterTypeSqliteConfiguration . lower ( value)
5842+ }
5843+
5844+
57565845public enum BitwardenError : Swift . Error {
57575846
57585847
@@ -7123,7 +7212,10 @@ private let initializationResult: InitializationResult = {
71237212 if ( uniffi_bitwarden_uniffi_checksum_method_sshclient_import_ssh_key ( ) != 34814 ) {
71247213 return InitializationResult . apiChecksumMismatch
71257214 }
7126- if ( uniffi_bitwarden_uniffi_checksum_method_stateclient_register_cipher_repository ( ) != 64881 ) {
7215+ if ( uniffi_bitwarden_uniffi_checksum_method_stateclient_initialize_state ( ) != 27371 ) {
7216+ return InitializationResult . apiChecksumMismatch
7217+ }
7218+ if ( uniffi_bitwarden_uniffi_checksum_method_stateclient_register_cipher_repository ( ) != 63324 ) {
71277219 return InitializationResult . apiChecksumMismatch
71287220 }
71297221 if ( uniffi_bitwarden_uniffi_checksum_method_vaultclient_attachments ( ) != 23471 ) {
@@ -7154,16 +7246,16 @@ private let initializationResult: InitializationResult = {
71547246 uniffiCallbackInitCipherRepository ( )
71557247 uniffiCallbackInitFido2CredentialStore ( )
71567248 uniffiCallbackInitFido2UserInterface ( )
7157- uniffiEnsureBitwardenSendInitialized ( )
7158- uniffiEnsureBitwardenCollectionsInitialized ( )
7159- uniffiEnsureBitwardenFidoInitialized ( )
7160- uniffiEnsureBitwardenCoreInitialized ( )
7161- uniffiEnsureBitwardenSshInitialized ( )
71627249 uniffiEnsureBitwardenCryptoInitialized ( )
7250+ uniffiEnsureBitwardenCoreInitialized ( )
71637251 uniffiEnsureBitwardenGeneratorsInitialized ( )
71647252 uniffiEnsureBitwardenVaultInitialized ( )
7253+ uniffiEnsureBitwardenSendInitialized ( )
71657254 uniffiEnsureBitwardenEncodingInitialized ( )
7255+ uniffiEnsureBitwardenCollectionsInitialized ( )
71667256 uniffiEnsureBitwardenExportersInitialized ( )
7257+ uniffiEnsureBitwardenFidoInitialized ( )
7258+ uniffiEnsureBitwardenSshInitialized ( )
71677259 return InitializationResult . ok
71687260} ( )
71697261
0 commit comments