Revision control
Copy as Markdown
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!
// swiftlint:disable all
import Foundation
// Depending on the consumer's build setup, the low-level FFI code
// might be in a separate module, or it might be compiled inline into
// this module. This is a bit of light hackery to work with both.
#if canImport(MozillaRustComponents)
import MozillaRustComponents
#endif
fileprivate extension RustBuffer {
// Allocate a new buffer, copying the contents of a `UInt8` array.
init(bytes: [UInt8]) {
let rbuf = bytes.withUnsafeBufferPointer { ptr in
RustBuffer.from(ptr)
}
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}
static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len:0, data: nil)
}
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_autofill_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
// Frees the buffer in place.
// The buffer must not be used after this is called.
func deallocate() {
try! rustCall { ffi_autofill_rustbuffer_free(self, $0) }
}
}
fileprivate extension ForeignBytes {
init(bufferPointer: UnsafeBufferPointer<UInt8>) {
self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress)
}
init(rawBufferPointer: UnsafeRawBufferPointer) {
self.init(
len: Int32(rawBufferPointer.count),
data: rawBufferPointer.baseAddress?.assumingMemoryBound(to: UInt8.self)
)
}
}
// Converter for `&[u8]` / `[ByRef] bytes` arguments.
//
// Conforms to `FfiConverter` so the compiler enforces the full converter
// method set. Only the scope-bound `lower(_:_body:)` overload is sound —
// zero-copy byte buffers only flow foreign -> Rust, and only in argument
// position. The four protocol-witness methods (`lift`, `lower`, `read`,
// `write`) `fatalError` at runtime if anyone reaches them.
//
// The scope-bound `lower` takes a closure because the `ForeignBytes`
// pointer is only guaranteed valid for the duration of
// `Data.withUnsafeBytes`. Callers must run the full FFI call inside
// the closure body.
fileprivate enum FfiConverterByRefBytes: FfiConverter {
typealias SwiftType = Data
typealias FfiType = ForeignBytes
static func lower<R>(_ value: Data, _ body: (ForeignBytes) throws -> R) rethrows -> R {
return try value.withUnsafeBytes { rawBuf in
try body(ForeignBytes(rawBufferPointer: rawBuf))
}
}
static func lower(_ value: Data) -> ForeignBytes {
fatalError("ByRef bytes cannot use the plain lower: returning ForeignBytes escapes the Data.withUnsafeBytes scope. Use the scope-bound lower(_:_body:) overload instead.")
}
static func lift(_ value: ForeignBytes) throws -> Data {
fatalError("ByRef bytes cannot be lifted: zero-copy &[u8] only flows foreign->Rust")
}
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data {
fatalError("ByRef bytes cannot be read from a buffer: zero-copy &[u8] is only supported in argument position, not nested in records/options/etc.")
}
static func write(_ value: Data, into buf: inout [UInt8]) {
fatalError("ByRef bytes cannot be written to a buffer: zero-copy &[u8] is only supported in argument position, not nested in records/options/etc.")
}
}
// For every type used in the interface, we provide helper methods for conveniently
// lifting and lowering that type from C-compatible data, and for reading and writing
// values of that type in a buffer.
// Helper classes/extensions that don't change.
// Someday, this will be in a library of its own.
fileprivate extension Data {
init(rustBuffer: RustBuffer) {
self.init(
bytesNoCopy: rustBuffer.data!,
count: Int(rustBuffer.len),
deallocator: .none
)
}
}
// Define reader functionality. Normally this would be defined in a class or
// struct, but we use standalone functions instead in order to make external
// types work.
//
// With external types, one swift source file needs to be able to call the read
// method on another source file's FfiConverter, but then what visibility
// should Reader have?
// - If Reader is fileprivate, then this means the read() must also
// be fileprivate, which doesn't work with external types.
// - If Reader is internal/public, we'll get compile errors since both source
// files will try define the same type.
//
// Instead, the read() method and these helper functions input a tuple of data
fileprivate func createReader(data: Data) -> (data: Data, offset: Data.Index) {
(data: data, offset: 0)
}
// Reads an integer at the current offset, in big-endian order, and advances
// the offset on success. Throws if reading the integer would move the
// offset past the end of the buffer.
fileprivate func readInt<T: FixedWidthInteger>(_ reader: inout (data: Data, offset: Data.Index)) throws -> T {
let range = reader.offset..<reader.offset + MemoryLayout<T>.size
guard reader.data.count >= range.upperBound else {
throw UniffiInternalError.bufferOverflow
}
if T.self == UInt8.self {
let value = reader.data[reader.offset]
reader.offset += 1
return value as! T
}
var value: T = 0
let _ = withUnsafeMutableBytes(of: &value, { reader.data.copyBytes(to: $0, from: range)})
reader.offset = range.upperBound
return value.bigEndian
}
// Reads an arbitrary number of bytes, to be used to read
// raw bytes, this is useful when lifting strings
fileprivate func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> Array<UInt8> {
let range = reader.offset..<(reader.offset+count)
guard reader.data.count >= range.upperBound else {
throw UniffiInternalError.bufferOverflow
}
var value = [UInt8](repeating: 0, count: count)
value.withUnsafeMutableBufferPointer({ buffer in
reader.data.copyBytes(to: buffer, from: range)
})
reader.offset = range.upperBound
return value
}
// Reads a float at the current offset.
fileprivate func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float {
return Float(bitPattern: try readInt(&reader))
}
// Reads a float at the current offset.
fileprivate func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double {
return Double(bitPattern: try readInt(&reader))
}
// Indicates if the offset has reached the end of the buffer.
fileprivate func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool {
return reader.offset < reader.data.count
}
// Define writer functionality. Normally this would be defined in a class or
// struct, but we use standalone functions instead in order to make external
// types work. See the above discussion on Readers for details.
fileprivate func createWriter() -> [UInt8] {
return []
}
fileprivate func writeBytes<S>(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 {
writer.append(contentsOf: byteArr)
}
// Writes an integer in big-endian order.
//
// Warning: make sure what you are trying to write
// is in the correct type!
fileprivate func writeInt<T: FixedWidthInteger>(_ writer: inout [UInt8], _ value: T) {
var value = value.bigEndian
withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) }
}
fileprivate func writeFloat(_ writer: inout [UInt8], _ value: Float) {
writeInt(&writer, value.bitPattern)
}
fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
writeInt(&writer, value.bitPattern)
}
// Protocol for types that transfer other types across the FFI. This is
// analogous to the Rust trait of the same name.
fileprivate protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
static func lift(_ value: FfiType) throws -> SwiftType
static func lower(_ value: SwiftType) -> FfiType
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType
static func write(_ value: SwiftType, into buf: inout [UInt8])
}
// Types conforming to `Primitive` pass themselves directly over the FFI.
fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { }
extension FfiConverterPrimitive {
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public static func lift(_ value: FfiType) throws -> SwiftType {
return value
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public static func lower(_ value: SwiftType) -> FfiType {
return value
}
}
// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`.
// Used for complex types where it's hard to write a custom lift/lower.
fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {}
extension FfiConverterRustBuffer {
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public static func lift(_ buf: RustBuffer) throws -> SwiftType {
var reader = createReader(data: Data(rustBuffer: buf))
let value = try read(from: &reader)
if hasRemaining(reader) {
throw UniffiInternalError.incompleteData
}
buf.deallocate()
return value
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public static func lower(_ value: SwiftType) -> RustBuffer {
var writer = createWriter()
write(value, into: &writer)
return RustBuffer(bytes: writer)
}
}
// An error type for FFI errors. These errors occur at the UniFFI level, not
// the library level.
fileprivate enum UniffiInternalError: LocalizedError {
case bufferOverflow
case incompleteData
case unexpectedOptionalTag
case unexpectedEnumCase
case unexpectedNullPointer
case unexpectedRustCallStatusCode
case unexpectedRustCallError
case unexpectedStaleHandle
case rustPanic(_ message: String)
public var errorDescription: String? {
switch self {
case .bufferOverflow: return "Reading the requested value would read past the end of the buffer"
case .incompleteData: return "The buffer still has data after lifting its containing value"
case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1"
case .unexpectedEnumCase: return "Raw enum value doesn't match any cases"
case .unexpectedNullPointer: return "Raw pointer value was null"
case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code"
case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified"
case .unexpectedStaleHandle: return "The object in the handle map has been dropped already"
case let .rustPanic(message): return message
}
}
}
fileprivate extension NSLock {
func withLock<T>(f: () throws -> T) rethrows -> T {
self.lock()
defer { self.unlock() }
return try f()
}
}
fileprivate let CALL_SUCCESS: Int8 = 0
fileprivate let CALL_ERROR: Int8 = 1
fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2
fileprivate let CALL_CANCELLED: Int8 = 3
fileprivate extension RustCallStatus {
init() {
self.init(
code: CALL_SUCCESS,
errorBuf: RustBuffer.init(
capacity: 0,
len: 0,
data: nil
)
)
}
}
private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
let neverThrow: ((RustBuffer) throws -> Never)? = nil
return try makeRustCall(callback, errorHandler: neverThrow)
}
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureAutofillInitialized()
var callStatus = RustCallStatus.init()
let returnedVal = callback(&callStatus)
try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler)
return returnedVal
}
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
return
case CALL_ERROR:
if let errorHandler = errorHandler {
throw try errorHandler(callStatus.errorBuf)
} else {
callStatus.errorBuf.deallocate()
throw UniffiInternalError.unexpectedRustCallError
}
case CALL_UNEXPECTED_ERROR:
// When the rust code sees a panic, it tries to construct a RustBuffer
// with the message. But if that code panics, then it just sends back
// an empty buffer.
if callStatus.errorBuf.len > 0 {
throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf))
} else {
callStatus.errorBuf.deallocate()
throw UniffiInternalError.rustPanic("Rust panic")
}
case CALL_CANCELLED:
fatalError("Cancellation not supported yet")
default:
throw UniffiInternalError.unexpectedRustCallStatusCode
}
}
private func uniffiTraitInterfaceCall<T>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> ()
) {
do {
try writeReturn(makeCall())
} catch let error {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
private func uniffiTraitInterfaceCallWithError<T, E>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> (),
lowerError: (E) -> RustBuffer
) {
do {
try writeReturn(makeCall())
} catch let error as E {
callStatus.pointee.code = CALL_ERROR
callStatus.pointee.errorBuf = lowerError(error)
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
// Initial value and increment amount for handles.
// These ensure that SWIFT handles always have the lowest bit set
fileprivate let UNIFFI_HANDLEMAP_INITIAL: UInt64 = 1
fileprivate let UNIFFI_HANDLEMAP_DELTA: UInt64 = 2
fileprivate final class UniffiHandleMap<T>: @unchecked Sendable {
// All mutation happens with this lock held, which is why we implement @unchecked Sendable.
private let lock = NSLock()
private var map: [UInt64: T] = [:]
private var currentHandle: UInt64 = UNIFFI_HANDLEMAP_INITIAL
func insert(obj: T) -> UInt64 {
lock.withLock {
return doInsert(obj)
}
}
// Low-level insert function, this assumes `lock` is held.
private func doInsert(_ obj: T) -> UInt64 {
let handle = currentHandle
currentHandle += UNIFFI_HANDLEMAP_DELTA
map[handle] = obj
return handle
}
func get(handle: UInt64) throws -> T {
try lock.withLock {
guard let obj = map[handle] else {
throw UniffiInternalError.unexpectedStaleHandle
}
return obj
}
}
func clone(handle: UInt64) throws -> UInt64 {
try lock.withLock {
guard let obj = map[handle] else {
throw UniffiInternalError.unexpectedStaleHandle
}
return doInsert(obj)
}
}
@discardableResult
func remove(handle: UInt64) throws -> T {
try lock.withLock {
guard let obj = map.removeValue(forKey: handle) else {
throw UniffiInternalError.unexpectedStaleHandle
}
return obj
}
}
var count: Int {
get {
map.count
}
}
}
// Public interface members begin here.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterUInt64: FfiConverterPrimitive {
typealias FfiType = UInt64
typealias SwiftType = UInt64
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt64 {
return try lift(readInt(&buf))
}
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterInt64: FfiConverterPrimitive {
typealias FfiType = Int64
typealias SwiftType = Int64
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Int64 {
return try lift(readInt(&buf))
}
public static func write(_ value: Int64, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterBool : FfiConverter {
typealias FfiType = Int8
typealias SwiftType = Bool
public static func lift(_ value: Int8) throws -> Bool {
return value != 0
}
public static func lower(_ value: Bool) -> Int8 {
return value ? 1 : 0
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool {
return try lift(readInt(&buf))
}
public static func write(_ value: Bool, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterString: FfiConverter {
typealias SwiftType = String
typealias FfiType = RustBuffer
public static func lift(_ value: RustBuffer) throws -> String {
defer {
value.deallocate()
}
if value.data == nil {
return String()
}
let bytes = UnsafeBufferPointer<UInt8>(start: value.data!, count: Int(value.len))
// Use Swift's native UTF-8 decoder; `String(bytes:encoding:.utf8)` goes
// through Foundation's NSString and silently strips a leading U+FEFF BOM.
// Invalid UTF-8 substitutes U+FFFD instead of trapping (unreachable
// given Rust's `String` invariant).
return String(decoding: bytes, as: UTF8.self)
}
public static func lower(_ value: String) -> RustBuffer {
return value.utf8CString.withUnsafeBufferPointer { ptr in
// The swift string gives us int8_t, we want uint8_t.
ptr.withMemoryRebound(to: UInt8.self) { ptr in
// The swift string gives us a trailing null byte, we don't want it.
let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1))
return RustBuffer.from(buf)
}
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String {
let len: Int32 = try readInt(&buf)
// See `lift` above for why we avoid Foundation's NSString-backed decoder here.
return String(decoding: try readBytes(&buf, count: Int(len)), as: UTF8.self)
}
public static func write(_ value: String, into buf: inout [UInt8]) {
let len = Int32(value.utf8.count)
writeInt(&buf, len)
writeBytes(&buf, value.utf8)
}
}
/**
* The bridged sync engine for addresses, which wraps the
* `sync15::engine::SyncEngine` implemented by this component (see
* `sync15::engine::BridgedEngineWrapper`).
* NOTE: all timestamps here are milliseconds.
*/
public protocol AddressesBridgedEngineProtocol: AnyObject, Sendable {
func apply(serverModifiedMillis: Int64) throws -> [String]
func ensureCurrentSyncId(newSyncId: String) throws -> String
func lastSync() throws -> Int64
func reset() throws
func resetSyncId() throws -> String
func setUploaded(newTimestamp: Int64, uploadedIds: [String]) throws
func storeIncoming(incomingEnvelopesAsJson: [String]) throws
func syncFinished() throws
func syncId() throws -> String?
func syncStarted() throws
func wipe() throws
}
/**
* The bridged sync engine for addresses, which wraps the
* `sync15::engine::SyncEngine` implemented by this component (see
* `sync15::engine::BridgedEngineWrapper`).
* NOTE: all timestamps here are milliseconds.
*/
open class AddressesBridgedEngine: AddressesBridgedEngineProtocol, @unchecked Sendable {
fileprivate let handle: UInt64
/// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct NoHandle {
public init() {}
}
// TODO: We'd like this to be `private` but for Swifty reasons,
// we can't implement `FfiConverter` without making this `required` and we can't
// make it `required` without making it `public`.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
required public init(unsafeFromHandle handle: UInt64) {
self.handle = handle
}
// This constructor can be used to instantiate a fake object.
// - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
//
// - Warning:
// Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public init(noHandle: NoHandle) {
self.handle = 0
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func uniffiCloneHandle() -> UInt64 {
return try! rustCall { uniffi_autofill_fn_clone_addressesbridgedengine(self.handle, $0) }
}
// No primary constructor declared for this class.
deinit {
if handle == 0 {
// Mock objects have handle=0 don't try to free them
return
}
try! rustCall { uniffi_autofill_fn_free_addressesbridgedengine(handle, $0) }
}
open func apply(serverModifiedMillis: Int64)throws -> [String] {
return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_apply(
self.uniffiCloneHandle(),
FfiConverterInt64.lower(serverModifiedMillis),uniffiCallStatus
)
})
}
open func ensureCurrentSyncId(newSyncId: String)throws -> String {
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_ensure_current_sync_id(
self.uniffiCloneHandle(),
FfiConverterString.lower(newSyncId),uniffiCallStatus
)
})
}
open func lastSync()throws -> Int64 {
return try FfiConverterInt64.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_last_sync(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func reset()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_reset(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func resetSyncId()throws -> String {
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_reset_sync_id(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func setUploaded(newTimestamp: Int64, uploadedIds: [String])throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_set_uploaded(
self.uniffiCloneHandle(),
FfiConverterInt64.lower(newTimestamp),
FfiConverterSequenceString.lower(uploadedIds),uniffiCallStatus
)
}
}
open func storeIncoming(incomingEnvelopesAsJson: [String])throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_store_incoming(
self.uniffiCloneHandle(),
FfiConverterSequenceString.lower(incomingEnvelopesAsJson),uniffiCallStatus
)
}
}
open func syncFinished()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_sync_finished(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func syncId()throws -> String? {
return try FfiConverterOptionString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_sync_id(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func syncStarted()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_sync_started(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func wipe()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_addressesbridgedengine_wipe(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAddressesBridgedEngine: FfiConverter {
typealias FfiType = UInt64
typealias SwiftType = AddressesBridgedEngine
public static func lift(_ handle: UInt64) throws -> AddressesBridgedEngine {
return AddressesBridgedEngine(unsafeFromHandle: handle)
}
public static func lower(_ value: AddressesBridgedEngine) -> UInt64 {
return value.uniffiCloneHandle()
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressesBridgedEngine {
let handle: UInt64 = try readInt(&buf)
return try lift(handle)
}
public static func write(_ value: AddressesBridgedEngine, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressesBridgedEngine_lift(_ handle: UInt64) throws -> AddressesBridgedEngine {
return try FfiConverterTypeAddressesBridgedEngine.lift(handle)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressesBridgedEngine_lower(_ value: AddressesBridgedEngine) -> UInt64 {
return FfiConverterTypeAddressesBridgedEngine.lower(value)
}
/**
* The bridged sync engine for credit cards, which wraps the
* `sync15::engine::SyncEngine` implemented by this component (see
* `sync15::engine::BridgedEngineWrapper`).
* NOTE: all timestamps here are milliseconds.
*/
public protocol CreditCardsBridgedEngineProtocol: AnyObject, Sendable {
func apply(serverModifiedMillis: Int64) throws -> [String]
func ensureCurrentSyncId(newSyncId: String) throws -> String
func lastSync() throws -> Int64
func reset() throws
func resetSyncId() throws -> String
func setUploaded(newTimestamp: Int64, uploadedIds: [String]) throws
func storeIncoming(incomingEnvelopesAsJson: [String]) throws
func syncFinished() throws
func syncId() throws -> String?
func syncStarted() throws
func wipe() throws
}
/**
* The bridged sync engine for credit cards, which wraps the
* `sync15::engine::SyncEngine` implemented by this component (see
* `sync15::engine::BridgedEngineWrapper`).
* NOTE: all timestamps here are milliseconds.
*/
open class CreditCardsBridgedEngine: CreditCardsBridgedEngineProtocol, @unchecked Sendable {
fileprivate let handle: UInt64
/// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct NoHandle {
public init() {}
}
// TODO: We'd like this to be `private` but for Swifty reasons,
// we can't implement `FfiConverter` without making this `required` and we can't
// make it `required` without making it `public`.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
required public init(unsafeFromHandle handle: UInt64) {
self.handle = handle
}
// This constructor can be used to instantiate a fake object.
// - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
//
// - Warning:
// Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public init(noHandle: NoHandle) {
self.handle = 0
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func uniffiCloneHandle() -> UInt64 {
return try! rustCall { uniffi_autofill_fn_clone_creditcardsbridgedengine(self.handle, $0) }
}
// No primary constructor declared for this class.
deinit {
if handle == 0 {
// Mock objects have handle=0 don't try to free them
return
}
try! rustCall { uniffi_autofill_fn_free_creditcardsbridgedengine(handle, $0) }
}
open func apply(serverModifiedMillis: Int64)throws -> [String] {
return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_apply(
self.uniffiCloneHandle(),
FfiConverterInt64.lower(serverModifiedMillis),uniffiCallStatus
)
})
}
open func ensureCurrentSyncId(newSyncId: String)throws -> String {
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_ensure_current_sync_id(
self.uniffiCloneHandle(),
FfiConverterString.lower(newSyncId),uniffiCallStatus
)
})
}
open func lastSync()throws -> Int64 {
return try FfiConverterInt64.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_last_sync(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func reset()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_reset(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func resetSyncId()throws -> String {
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_reset_sync_id(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func setUploaded(newTimestamp: Int64, uploadedIds: [String])throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_set_uploaded(
self.uniffiCloneHandle(),
FfiConverterInt64.lower(newTimestamp),
FfiConverterSequenceString.lower(uploadedIds),uniffiCallStatus
)
}
}
open func storeIncoming(incomingEnvelopesAsJson: [String])throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_store_incoming(
self.uniffiCloneHandle(),
FfiConverterSequenceString.lower(incomingEnvelopesAsJson),uniffiCallStatus
)
}
}
open func syncFinished()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_sync_finished(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func syncId()throws -> String? {
return try FfiConverterOptionString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_sync_id(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func syncStarted()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_sync_started(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func wipe()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_creditcardsbridgedengine_wipe(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardsBridgedEngine: FfiConverter {
typealias FfiType = UInt64
typealias SwiftType = CreditCardsBridgedEngine
public static func lift(_ handle: UInt64) throws -> CreditCardsBridgedEngine {
return CreditCardsBridgedEngine(unsafeFromHandle: handle)
}
public static func lower(_ value: CreditCardsBridgedEngine) -> UInt64 {
return value.uniffiCloneHandle()
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardsBridgedEngine {
let handle: UInt64 = try readInt(&buf)
return try lift(handle)
}
public static func write(_ value: CreditCardsBridgedEngine, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardsBridgedEngine_lift(_ handle: UInt64) throws -> CreditCardsBridgedEngine {
return try FfiConverterTypeCreditCardsBridgedEngine.lift(handle)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardsBridgedEngine_lower(_ value: CreditCardsBridgedEngine) -> UInt64 {
return FfiConverterTypeCreditCardsBridgedEngine.lower(value)
}
public protocol StoreProtocol: AnyObject, Sendable {
func addAddress(a: UpdatableAddressFields) throws -> Address
func addAddressWithMeta(entryWithMeta: UpdatableAddressFieldsWithMeta) throws -> Address
func addCreditCard(cc: UpdatableCreditCardFields) throws -> CreditCard
func addCreditCardWithMeta(entryWithMeta: UpdatableCreditCardFieldsWithMeta) throws -> CreditCard
func addManyAddressTombstones(tombstones: [AddressTombstone]) throws -> [AddressBulkTombstoneResultEntry]
func addManyAddressesWithMeta(entriesWithMeta: [UpdatableAddressFieldsWithMeta]) throws -> [AddressBulkResultEntry]
func addManyCreditCardTombstones(tombstones: [CreditCardTombstone]) throws -> [CreditCardBulkTombstoneResultEntry]
func addManyCreditCardsWithMeta(entriesWithMeta: [UpdatableCreditCardFieldsWithMeta]) throws -> [CreditCardBulkResultEntry]
func addPassport(p: UpdatablePassportFields) throws -> Passport
/**
* Returns a bridged sync engine for addresses, for use by Desktop's Sync
* framework. Constructing it only assembles structs and never touches the
* DB, so it cannot fail.
*/
func addressesBridgedEngine() -> AddressesBridgedEngine
func countAllAddresses() throws -> Int64
func countAllCreditCards() throws -> Int64
func countAllPassports() throws -> Int64
/**
* Returns a bridged sync engine for credit cards, for use by Desktop's
* Sync framework. Constructing it only assembles structs and never touches
* the DB, so it cannot fail.
*/
func creditCardsBridgedEngine() -> CreditCardsBridgedEngine
func deleteAddress(guid: String) throws -> Bool
/**
* Removes every address and every address tombstone.
*
* A migration primitive: it leaves the sync mirror intact and produces no
* tombstones, so the deletions are never uploaded and a synced profile gets
* the records back on the next sync. Use `delete_address` to delete on the
* user's behalf.
*/
func deleteAllAddresses() throws
/**
* Removes every credit card and every credit card tombstone.
*
* A migration primitive: it leaves the sync mirror intact and produces no
* tombstones, so the deletions are never uploaded and a synced profile gets
* the records back on the next sync. Use `delete_credit_card` to delete on the
* user's behalf.
*/
func deleteAllCreditCards() throws
func deleteCreditCard(guid: String) throws -> Bool
func deletePassport(guid: String) throws -> Bool
func getAddress(guid: String) throws -> Address
func getAllAddresses() throws -> [Address]
func getAllCreditCards() throws -> [CreditCard]
func getAllPassports() throws -> [Passport]
func getCreditCard(guid: String) throws -> CreditCard
func getPassport(guid: String) throws -> Passport
/**
* Every stored credit card without its encrypted fields. Unlike
* `get_all_credit_cards` this never touches the key, so listing cannot
* prompt for a primary password; read the one card that needs its
* secrets with `get_credit_card`.
*/
func listCreditCardCandidates() throws -> [CreditCardCandidate]
func registerWithSyncManager()
/**
* Run maintenance on the DB
*
* This is intended to be run during idle time and will take steps / to clean up / shrink the
* database.
*/
func runMaintenance() throws
func scrubEncryptedData() throws
/**
* The `scrub_undecryptable_credit_card_data_for_remote_replacement` function locally scrubs credit cards
* that cannot be decrypted, sets the record's metadata to their default values, and resets the credit card
* engine so any existing server records can overwrite the locally scrubbed records.
*
* NB: This function was created to unblock iOS credit card users who are unable to sync records and should not be used
* outside of this use case.
*/
func scrubUndecryptableCreditCardDataForRemoteReplacement() throws -> CreditCardsDeletionMetrics
func shutdown()
func touchAddress(guid: String) throws
func touchCreditCard(guid: String) throws
func touchPassport(guid: String) throws
func updateAddress(guid: String, a: UpdatableAddressFields) throws
func updateAddressWithMeta(entryWithMeta: UpdatableAddressFieldsWithMeta) throws
func updateCreditCard(guid: String, cc: UpdatableCreditCardFields) throws
func updateCreditCardWithMeta(entryWithMeta: UpdatableCreditCardFieldsWithMeta) throws
func updatePassport(guid: String, p: UpdatablePassportFields) throws
}
open class Store: StoreProtocol, @unchecked Sendable {
fileprivate let handle: UInt64
/// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct NoHandle {
public init() {}
}
// TODO: We'd like this to be `private` but for Swifty reasons,
// we can't implement `FfiConverter` without making this `required` and we can't
// make it `required` without making it `public`.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
required public init(unsafeFromHandle handle: UInt64) {
self.handle = handle
}
// This constructor can be used to instantiate a fake object.
// - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
//
// - Warning:
// Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public init(noHandle: NoHandle) {
self.handle = 0
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func uniffiCloneHandle() -> UInt64 {
return try! rustCall { uniffi_autofill_fn_clone_store(self.handle, $0) }
}
public convenience init(dbpath: String, encdec: EncryptorDecryptor)throws {
let handle =
try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_constructor_store_new(
FfiConverterString.lower(dbpath),
FfiConverterTypeEncryptorDecryptor_lower(encdec),uniffiCallStatus
)
}
self.init(unsafeFromHandle: handle)
}
deinit {
if handle == 0 {
// Mock objects have handle=0 don't try to free them
return
}
try! rustCall { uniffi_autofill_fn_free_store(handle, $0) }
}
open func addAddress(a: UpdatableAddressFields)throws -> Address {
return try FfiConverterTypeAddress_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_address(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatableAddressFields_lower(a),uniffiCallStatus
)
})
}
open func addAddressWithMeta(entryWithMeta: UpdatableAddressFieldsWithMeta)throws -> Address {
return try FfiConverterTypeAddress_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_address_with_meta(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatableAddressFieldsWithMeta_lower(entryWithMeta),uniffiCallStatus
)
})
}
open func addCreditCard(cc: UpdatableCreditCardFields)throws -> CreditCard {
return try FfiConverterTypeCreditCard_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_credit_card(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatableCreditCardFields_lower(cc),uniffiCallStatus
)
})
}
open func addCreditCardWithMeta(entryWithMeta: UpdatableCreditCardFieldsWithMeta)throws -> CreditCard {
return try FfiConverterTypeCreditCard_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_credit_card_with_meta(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatableCreditCardFieldsWithMeta_lower(entryWithMeta),uniffiCallStatus
)
})
}
open func addManyAddressTombstones(tombstones: [AddressTombstone])throws -> [AddressBulkTombstoneResultEntry] {
return try FfiConverterSequenceTypeAddressBulkTombstoneResultEntry.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_many_address_tombstones(
self.uniffiCloneHandle(),
FfiConverterSequenceTypeAddressTombstone.lower(tombstones),uniffiCallStatus
)
})
}
open func addManyAddressesWithMeta(entriesWithMeta: [UpdatableAddressFieldsWithMeta])throws -> [AddressBulkResultEntry] {
return try FfiConverterSequenceTypeAddressBulkResultEntry.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_many_addresses_with_meta(
self.uniffiCloneHandle(),
FfiConverterSequenceTypeUpdatableAddressFieldsWithMeta.lower(entriesWithMeta),uniffiCallStatus
)
})
}
open func addManyCreditCardTombstones(tombstones: [CreditCardTombstone])throws -> [CreditCardBulkTombstoneResultEntry] {
return try FfiConverterSequenceTypeCreditCardBulkTombstoneResultEntry.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_many_credit_card_tombstones(
self.uniffiCloneHandle(),
FfiConverterSequenceTypeCreditCardTombstone.lower(tombstones),uniffiCallStatus
)
})
}
open func addManyCreditCardsWithMeta(entriesWithMeta: [UpdatableCreditCardFieldsWithMeta])throws -> [CreditCardBulkResultEntry] {
return try FfiConverterSequenceTypeCreditCardBulkResultEntry.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_many_credit_cards_with_meta(
self.uniffiCloneHandle(),
FfiConverterSequenceTypeUpdatableCreditCardFieldsWithMeta.lower(entriesWithMeta),uniffiCallStatus
)
})
}
open func addPassport(p: UpdatablePassportFields)throws -> Passport {
return try FfiConverterTypePassport_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_add_passport(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatablePassportFields_lower(p),uniffiCallStatus
)
})
}
/**
* Returns a bridged sync engine for addresses, for use by Desktop's Sync
* framework. Constructing it only assembles structs and never touches the
* DB, so it cannot fail.
*/
open func addressesBridgedEngine() -> AddressesBridgedEngine {
return try! FfiConverterTypeAddressesBridgedEngine_lift(try! rustCall() {
uniffiCallStatus in
uniffi_autofill_fn_method_store_addresses_bridged_engine(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func countAllAddresses()throws -> Int64 {
return try FfiConverterInt64.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_count_all_addresses(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func countAllCreditCards()throws -> Int64 {
return try FfiConverterInt64.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_count_all_credit_cards(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func countAllPassports()throws -> Int64 {
return try FfiConverterInt64.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_count_all_passports(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
/**
* Returns a bridged sync engine for credit cards, for use by Desktop's
* Sync framework. Constructing it only assembles structs and never touches
* the DB, so it cannot fail.
*/
open func creditCardsBridgedEngine() -> CreditCardsBridgedEngine {
return try! FfiConverterTypeCreditCardsBridgedEngine_lift(try! rustCall() {
uniffiCallStatus in
uniffi_autofill_fn_method_store_credit_cards_bridged_engine(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func deleteAddress(guid: String)throws -> Bool {
return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_delete_address(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
})
}
/**
* Removes every address and every address tombstone.
*
* A migration primitive: it leaves the sync mirror intact and produces no
* tombstones, so the deletions are never uploaded and a synced profile gets
* the records back on the next sync. Use `delete_address` to delete on the
* user's behalf.
*/
open func deleteAllAddresses()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_delete_all_addresses(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
/**
* Removes every credit card and every credit card tombstone.
*
* A migration primitive: it leaves the sync mirror intact and produces no
* tombstones, so the deletions are never uploaded and a synced profile gets
* the records back on the next sync. Use `delete_credit_card` to delete on the
* user's behalf.
*/
open func deleteAllCreditCards()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_delete_all_credit_cards(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func deleteCreditCard(guid: String)throws -> Bool {
return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_delete_credit_card(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
})
}
open func deletePassport(guid: String)throws -> Bool {
return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_delete_passport(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
})
}
open func getAddress(guid: String)throws -> Address {
return try FfiConverterTypeAddress_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_get_address(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
})
}
open func getAllAddresses()throws -> [Address] {
return try FfiConverterSequenceTypeAddress.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_get_all_addresses(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func getAllCreditCards()throws -> [CreditCard] {
return try FfiConverterSequenceTypeCreditCard.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_get_all_credit_cards(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func getAllPassports()throws -> [Passport] {
return try FfiConverterSequenceTypePassport.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_get_all_passports(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func getCreditCard(guid: String)throws -> CreditCard {
return try FfiConverterTypeCreditCard_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_get_credit_card(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
})
}
open func getPassport(guid: String)throws -> Passport {
return try FfiConverterTypePassport_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_get_passport(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
})
}
/**
* Every stored credit card without its encrypted fields. Unlike
* `get_all_credit_cards` this never touches the key, so listing cannot
* prompt for a primary password; read the one card that needs its
* secrets with `get_credit_card`.
*/
open func listCreditCardCandidates()throws -> [CreditCardCandidate] {
return try FfiConverterSequenceTypeCreditCardCandidate.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_list_credit_card_candidates(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func registerWithSyncManager() {try! rustCall() {
uniffiCallStatus in
uniffi_autofill_fn_method_store_register_with_sync_manager(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
/**
* Run maintenance on the DB
*
* This is intended to be run during idle time and will take steps / to clean up / shrink the
* database.
*/
open func runMaintenance()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_run_maintenance(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func scrubEncryptedData()throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_scrub_encrypted_data(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
/**
* The `scrub_undecryptable_credit_card_data_for_remote_replacement` function locally scrubs credit cards
* that cannot be decrypted, sets the record's metadata to their default values, and resets the credit card
* engine so any existing server records can overwrite the locally scrubbed records.
*
* NB: This function was created to unblock iOS credit card users who are unable to sync records and should not be used
* outside of this use case.
*/
open func scrubUndecryptableCreditCardDataForRemoteReplacement()throws -> CreditCardsDeletionMetrics {
return try FfiConverterTypeCreditCardsDeletionMetrics_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_scrub_undecryptable_credit_card_data_for_remote_replacement(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func shutdown() {try! rustCall() {
uniffiCallStatus in
uniffi_autofill_fn_method_store_shutdown(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func touchAddress(guid: String)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_touch_address(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
}
}
open func touchCreditCard(guid: String)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_touch_credit_card(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
}
}
open func touchPassport(guid: String)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_touch_passport(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),uniffiCallStatus
)
}
}
open func updateAddress(guid: String, a: UpdatableAddressFields)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_update_address(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),
FfiConverterTypeUpdatableAddressFields_lower(a),uniffiCallStatus
)
}
}
open func updateAddressWithMeta(entryWithMeta: UpdatableAddressFieldsWithMeta)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_update_address_with_meta(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatableAddressFieldsWithMeta_lower(entryWithMeta),uniffiCallStatus
)
}
}
open func updateCreditCard(guid: String, cc: UpdatableCreditCardFields)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_update_credit_card(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),
FfiConverterTypeUpdatableCreditCardFields_lower(cc),uniffiCallStatus
)
}
}
open func updateCreditCardWithMeta(entryWithMeta: UpdatableCreditCardFieldsWithMeta)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_update_credit_card_with_meta(
self.uniffiCloneHandle(),
FfiConverterTypeUpdatableCreditCardFieldsWithMeta_lower(entryWithMeta),uniffiCallStatus
)
}
}
open func updatePassport(guid: String, p: UpdatablePassportFields)throws {try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_method_store_update_passport(
self.uniffiCloneHandle(),
FfiConverterString.lower(guid),
FfiConverterTypeUpdatablePassportFields_lower(p),uniffiCallStatus
)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeStore: FfiConverter {
typealias FfiType = UInt64
typealias SwiftType = Store
public static func lift(_ handle: UInt64) throws -> Store {
return Store(unsafeFromHandle: handle)
}
public static func lower(_ value: Store) -> UInt64 {
return value.uniffiCloneHandle()
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Store {
let handle: UInt64 = try readInt(&buf)
return try lift(handle)
}
public static func write(_ value: Store, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeStore_lift(_ handle: UInt64) throws -> Store {
return try FfiConverterTypeStore.lift(handle)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeStore_lower(_ value: Store) -> UInt64 {
return FfiConverterTypeStore.lower(value)
}
/**
* What you get back as an address.
*/
public struct Address: Equatable, Hashable {
public var guid: String
public var name: String
public var organization: String
public var streetAddress: String
public var addressLevel3: String
public var addressLevel2: String
public var addressLevel1: String
public var postalCode: String
public var country: String
public var tel: String
public var email: String
public var timeCreated: Int64
public var timeLastUsed: Int64?
public var timeLastModified: Int64
public var timesUsed: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, name: String, organization: String, streetAddress: String, addressLevel3: String, addressLevel2: String, addressLevel1: String, postalCode: String, country: String, tel: String, email: String, timeCreated: Int64, timeLastUsed: Int64?, timeLastModified: Int64, timesUsed: Int64) {
self.guid = guid
self.name = name
self.organization = organization
self.streetAddress = streetAddress
self.addressLevel3 = addressLevel3
self.addressLevel2 = addressLevel2
self.addressLevel1 = addressLevel1
self.postalCode = postalCode
self.country = country
self.tel = tel
self.email = email
self.timeCreated = timeCreated
self.timeLastUsed = timeLastUsed
self.timeLastModified = timeLastModified
self.timesUsed = timesUsed
}
}
#if compiler(>=6)
extension Address: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAddress: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Address {
return
try Address(
guid: FfiConverterString.read(from: &buf),
name: FfiConverterString.read(from: &buf),
organization: FfiConverterString.read(from: &buf),
streetAddress: FfiConverterString.read(from: &buf),
addressLevel3: FfiConverterString.read(from: &buf),
addressLevel2: FfiConverterString.read(from: &buf),
addressLevel1: FfiConverterString.read(from: &buf),
postalCode: FfiConverterString.read(from: &buf),
country: FfiConverterString.read(from: &buf),
tel: FfiConverterString.read(from: &buf),
email: FfiConverterString.read(from: &buf),
timeCreated: FfiConverterInt64.read(from: &buf),
timeLastUsed: FfiConverterOptionInt64.read(from: &buf),
timeLastModified: FfiConverterInt64.read(from: &buf),
timesUsed: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: Address, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterString.write(value.name, into: &buf)
FfiConverterString.write(value.organization, into: &buf)
FfiConverterString.write(value.streetAddress, into: &buf)
FfiConverterString.write(value.addressLevel3, into: &buf)
FfiConverterString.write(value.addressLevel2, into: &buf)
FfiConverterString.write(value.addressLevel1, into: &buf)
FfiConverterString.write(value.postalCode, into: &buf)
FfiConverterString.write(value.country, into: &buf)
FfiConverterString.write(value.tel, into: &buf)
FfiConverterString.write(value.email, into: &buf)
FfiConverterInt64.write(value.timeCreated, into: &buf)
FfiConverterOptionInt64.write(value.timeLastUsed, into: &buf)
FfiConverterInt64.write(value.timeLastModified, into: &buf)
FfiConverterInt64.write(value.timesUsed, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddress_lift(_ buf: RustBuffer) throws -> Address {
return try FfiConverterTypeAddress.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddress_lower(_ value: Address) -> RustBuffer {
return FfiConverterTypeAddress.lower(value)
}
/**
* Metadata fields managed internally by the library: the guid, timestamps and
* local sync state. These are automatically set on `add_address` and updated on
* operations like `touch` and `update_address`. Not included in
* `UpdatableAddressFields`; use `add_address_with_meta` when importing records
* that already have metadata.
*/
public struct AddressMeta: Equatable, Hashable {
public var guid: String
public var timeCreated: Int64
public var timeLastUsed: Int64?
public var timeLastModified: Int64
public var timesUsed: Int64
public var syncChangeCounter: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, timeCreated: Int64, timeLastUsed: Int64?, timeLastModified: Int64, timesUsed: Int64, syncChangeCounter: Int64) {
self.guid = guid
self.timeCreated = timeCreated
self.timeLastUsed = timeLastUsed
self.timeLastModified = timeLastModified
self.timesUsed = timesUsed
self.syncChangeCounter = syncChangeCounter
}
}
#if compiler(>=6)
extension AddressMeta: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAddressMeta: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressMeta {
return
try AddressMeta(
guid: FfiConverterString.read(from: &buf),
timeCreated: FfiConverterInt64.read(from: &buf),
timeLastUsed: FfiConverterOptionInt64.read(from: &buf),
timeLastModified: FfiConverterInt64.read(from: &buf),
timesUsed: FfiConverterInt64.read(from: &buf),
syncChangeCounter: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: AddressMeta, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterInt64.write(value.timeCreated, into: &buf)
FfiConverterOptionInt64.write(value.timeLastUsed, into: &buf)
FfiConverterInt64.write(value.timeLastModified, into: &buf)
FfiConverterInt64.write(value.timesUsed, into: &buf)
FfiConverterInt64.write(value.syncChangeCounter, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressMeta_lift(_ buf: RustBuffer) throws -> AddressMeta {
return try FfiConverterTypeAddressMeta.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressMeta_lower(_ value: AddressMeta) -> RustBuffer {
return FfiConverterTypeAddressMeta.lower(value)
}
/**
* A tombstone for a record deleted locally but not yet uploaded, supplied to
* `add_many_address_tombstones` when migrating from another store.
*/
public struct AddressTombstone: Equatable, Hashable {
public var guid: String
public var timeDeleted: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, timeDeleted: Int64) {
self.guid = guid
self.timeDeleted = timeDeleted
}
}
#if compiler(>=6)
extension AddressTombstone: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAddressTombstone: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressTombstone {
return
try AddressTombstone(
guid: FfiConverterString.read(from: &buf),
timeDeleted: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: AddressTombstone, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterInt64.write(value.timeDeleted, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressTombstone_lift(_ buf: RustBuffer) throws -> AddressTombstone {
return try FfiConverterTypeAddressTombstone.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressTombstone_lower(_ value: AddressTombstone) -> RustBuffer {
return FfiConverterTypeAddressTombstone.lower(value)
}
/**
* What you get back as a credit-card. The number comes back decrypted;
* it is empty for a scrubbed card or one saved without a number. A number
* the key cannot read fails the read.
*/
public struct CreditCard: Equatable, Hashable {
public var guid: String
public var ccName: String
public var ccNumber: String
public var ccCvv: String?
public var ccNumberLast4: String
public var ccExpMonth: Int64
public var ccExpYear: Int64
public var ccType: String
public var timeCreated: Int64
public var timeLastUsed: Int64?
public var timeLastModified: Int64
public var timesUsed: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, ccName: String, ccNumber: String, ccCvv: String? = nil, ccNumberLast4: String, ccExpMonth: Int64, ccExpYear: Int64, ccType: String, timeCreated: Int64, timeLastUsed: Int64?, timeLastModified: Int64, timesUsed: Int64) {
self.guid = guid
self.ccName = ccName
self.ccNumber = ccNumber
self.ccCvv = ccCvv
self.ccNumberLast4 = ccNumberLast4
self.ccExpMonth = ccExpMonth
self.ccExpYear = ccExpYear
self.ccType = ccType
self.timeCreated = timeCreated
self.timeLastUsed = timeLastUsed
self.timeLastModified = timeLastModified
self.timesUsed = timesUsed
}
}
#if compiler(>=6)
extension CreditCard: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCard: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCard {
return
try CreditCard(
guid: FfiConverterString.read(from: &buf),
ccName: FfiConverterString.read(from: &buf),
ccNumber: FfiConverterString.read(from: &buf),
ccCvv: FfiConverterOptionString.read(from: &buf),
ccNumberLast4: FfiConverterString.read(from: &buf),
ccExpMonth: FfiConverterInt64.read(from: &buf),
ccExpYear: FfiConverterInt64.read(from: &buf),
ccType: FfiConverterString.read(from: &buf),
timeCreated: FfiConverterInt64.read(from: &buf),
timeLastUsed: FfiConverterOptionInt64.read(from: &buf),
timeLastModified: FfiConverterInt64.read(from: &buf),
timesUsed: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: CreditCard, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterString.write(value.ccName, into: &buf)
FfiConverterString.write(value.ccNumber, into: &buf)
FfiConverterOptionString.write(value.ccCvv, into: &buf)
FfiConverterString.write(value.ccNumberLast4, into: &buf)
FfiConverterInt64.write(value.ccExpMonth, into: &buf)
FfiConverterInt64.write(value.ccExpYear, into: &buf)
FfiConverterString.write(value.ccType, into: &buf)
FfiConverterInt64.write(value.timeCreated, into: &buf)
FfiConverterOptionInt64.write(value.timeLastUsed, into: &buf)
FfiConverterInt64.write(value.timeLastModified, into: &buf)
FfiConverterInt64.write(value.timesUsed, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCard_lift(_ buf: RustBuffer) throws -> CreditCard {
return try FfiConverterTypeCreditCard.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCard_lower(_ value: CreditCard) -> RustBuffer {
return FfiConverterTypeCreditCard.lower(value)
}
/**
* A credit card stored in the database, minus the encrypted fields.
*
* Reading these never needs the encryption key, so consumers listing cards by name,
* last four digits and expiry can do so without forcing the user to authenticate.
* See `list_credit_card_candidates()`.
*/
public struct CreditCardCandidate: Equatable, Hashable {
public var guid: String
public var ccName: String
public var ccNumberLast4: String
public var hasCvv: Bool
public var ccExpMonth: Int64
public var ccExpYear: Int64
public var ccType: String
public var timeCreated: Int64
public var timeLastUsed: Int64?
public var timeLastModified: Int64
public var timesUsed: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, ccName: String, ccNumberLast4: String, hasCvv: Bool, ccExpMonth: Int64, ccExpYear: Int64, ccType: String, timeCreated: Int64, timeLastUsed: Int64?, timeLastModified: Int64, timesUsed: Int64) {
self.guid = guid
self.ccName = ccName
self.ccNumberLast4 = ccNumberLast4
self.hasCvv = hasCvv
self.ccExpMonth = ccExpMonth
self.ccExpYear = ccExpYear
self.ccType = ccType
self.timeCreated = timeCreated
self.timeLastUsed = timeLastUsed
self.timeLastModified = timeLastModified
self.timesUsed = timesUsed
}
}
#if compiler(>=6)
extension CreditCardCandidate: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardCandidate: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardCandidate {
return
try CreditCardCandidate(
guid: FfiConverterString.read(from: &buf),
ccName: FfiConverterString.read(from: &buf),
ccNumberLast4: FfiConverterString.read(from: &buf),
hasCvv: FfiConverterBool.read(from: &buf),
ccExpMonth: FfiConverterInt64.read(from: &buf),
ccExpYear: FfiConverterInt64.read(from: &buf),
ccType: FfiConverterString.read(from: &buf),
timeCreated: FfiConverterInt64.read(from: &buf),
timeLastUsed: FfiConverterOptionInt64.read(from: &buf),
timeLastModified: FfiConverterInt64.read(from: &buf),
timesUsed: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: CreditCardCandidate, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterString.write(value.ccName, into: &buf)
FfiConverterString.write(value.ccNumberLast4, into: &buf)
FfiConverterBool.write(value.hasCvv, into: &buf)
FfiConverterInt64.write(value.ccExpMonth, into: &buf)
FfiConverterInt64.write(value.ccExpYear, into: &buf)
FfiConverterString.write(value.ccType, into: &buf)
FfiConverterInt64.write(value.timeCreated, into: &buf)
FfiConverterOptionInt64.write(value.timeLastUsed, into: &buf)
FfiConverterInt64.write(value.timeLastModified, into: &buf)
FfiConverterInt64.write(value.timesUsed, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardCandidate_lift(_ buf: RustBuffer) throws -> CreditCardCandidate {
return try FfiConverterTypeCreditCardCandidate.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardCandidate_lower(_ value: CreditCardCandidate) -> RustBuffer {
return FfiConverterTypeCreditCardCandidate.lower(value)
}
/**
* Metadata fields managed internally by the library: the guid, timestamps and
* local sync state. These are automatically set on `add_credit_card` and
* updated on operations like `touch` and `update_credit_card`. Not included in
* `UpdatableCreditCardFields`; use `add_credit_card_with_meta` when importing
* records that already have metadata.
*/
public struct CreditCardMeta: Equatable, Hashable {
public var guid: String
public var timeCreated: Int64
public var timeLastUsed: Int64?
public var timeLastModified: Int64
public var timesUsed: Int64
public var syncChangeCounter: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, timeCreated: Int64, timeLastUsed: Int64?, timeLastModified: Int64, timesUsed: Int64, syncChangeCounter: Int64) {
self.guid = guid
self.timeCreated = timeCreated
self.timeLastUsed = timeLastUsed
self.timeLastModified = timeLastModified
self.timesUsed = timesUsed
self.syncChangeCounter = syncChangeCounter
}
}
#if compiler(>=6)
extension CreditCardMeta: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardMeta: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardMeta {
return
try CreditCardMeta(
guid: FfiConverterString.read(from: &buf),
timeCreated: FfiConverterInt64.read(from: &buf),
timeLastUsed: FfiConverterOptionInt64.read(from: &buf),
timeLastModified: FfiConverterInt64.read(from: &buf),
timesUsed: FfiConverterInt64.read(from: &buf),
syncChangeCounter: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: CreditCardMeta, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterInt64.write(value.timeCreated, into: &buf)
FfiConverterOptionInt64.write(value.timeLastUsed, into: &buf)
FfiConverterInt64.write(value.timeLastModified, into: &buf)
FfiConverterInt64.write(value.timesUsed, into: &buf)
FfiConverterInt64.write(value.syncChangeCounter, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardMeta_lift(_ buf: RustBuffer) throws -> CreditCardMeta {
return try FfiConverterTypeCreditCardMeta.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardMeta_lower(_ value: CreditCardMeta) -> RustBuffer {
return FfiConverterTypeCreditCardMeta.lower(value)
}
/**
* A tombstone for a record deleted locally but not yet uploaded, supplied to
* `add_many_credit_card_tombstones` when migrating from another store.
*/
public struct CreditCardTombstone: Equatable, Hashable {
public var guid: String
public var timeDeleted: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, timeDeleted: Int64) {
self.guid = guid
self.timeDeleted = timeDeleted
}
}
#if compiler(>=6)
extension CreditCardTombstone: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardTombstone: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardTombstone {
return
try CreditCardTombstone(
guid: FfiConverterString.read(from: &buf),
timeDeleted: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: CreditCardTombstone, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterInt64.write(value.timeDeleted, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardTombstone_lift(_ buf: RustBuffer) throws -> CreditCardTombstone {
return try FfiConverterTypeCreditCardTombstone.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardTombstone_lower(_ value: CreditCardTombstone) -> RustBuffer {
return FfiConverterTypeCreditCardTombstone.lower(value)
}
/**
* Metrics tracking scrubbing of credit cards that cannot be decrypted, see
*/
public struct CreditCardsDeletionMetrics: Equatable, Hashable {
public var totalScrubbedRecords: UInt64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(totalScrubbedRecords: UInt64) {
self.totalScrubbedRecords = totalScrubbedRecords
}
}
#if compiler(>=6)
extension CreditCardsDeletionMetrics: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardsDeletionMetrics: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardsDeletionMetrics {
return
try CreditCardsDeletionMetrics(
totalScrubbedRecords: FfiConverterUInt64.read(from: &buf)
)
}
public static func write(_ value: CreditCardsDeletionMetrics, into buf: inout [UInt8]) {
FfiConverterUInt64.write(value.totalScrubbedRecords, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardsDeletionMetrics_lift(_ buf: RustBuffer) throws -> CreditCardsDeletionMetrics {
return try FfiConverterTypeCreditCardsDeletionMetrics.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardsDeletionMetrics_lower(_ value: CreditCardsDeletionMetrics) -> RustBuffer {
return FfiConverterTypeCreditCardsDeletionMetrics.lower(value)
}
/**
* What you get back as a passport.
*/
public struct Passport: Equatable, Hashable {
public var guid: String
public var name: String
public var country: String
public var passportNumber: String
public var issueDateMonth: Int64
public var issueDateDay: Int64
public var issueDateYear: Int64
public var expiryDateMonth: Int64
public var expiryDateDay: Int64
public var expiryDateYear: Int64
public var timeCreated: Int64
public var timeLastUsed: Int64?
public var timeLastModified: Int64
public var timesUsed: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(guid: String, name: String, country: String, passportNumber: String, issueDateMonth: Int64, issueDateDay: Int64, issueDateYear: Int64, expiryDateMonth: Int64, expiryDateDay: Int64, expiryDateYear: Int64, timeCreated: Int64, timeLastUsed: Int64?, timeLastModified: Int64, timesUsed: Int64) {
self.guid = guid
self.name = name
self.country = country
self.passportNumber = passportNumber
self.issueDateMonth = issueDateMonth
self.issueDateDay = issueDateDay
self.issueDateYear = issueDateYear
self.expiryDateMonth = expiryDateMonth
self.expiryDateDay = expiryDateDay
self.expiryDateYear = expiryDateYear
self.timeCreated = timeCreated
self.timeLastUsed = timeLastUsed
self.timeLastModified = timeLastModified
self.timesUsed = timesUsed
}
}
#if compiler(>=6)
extension Passport: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypePassport: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Passport {
return
try Passport(
guid: FfiConverterString.read(from: &buf),
name: FfiConverterString.read(from: &buf),
country: FfiConverterString.read(from: &buf),
passportNumber: FfiConverterString.read(from: &buf),
issueDateMonth: FfiConverterInt64.read(from: &buf),
issueDateDay: FfiConverterInt64.read(from: &buf),
issueDateYear: FfiConverterInt64.read(from: &buf),
expiryDateMonth: FfiConverterInt64.read(from: &buf),
expiryDateDay: FfiConverterInt64.read(from: &buf),
expiryDateYear: FfiConverterInt64.read(from: &buf),
timeCreated: FfiConverterInt64.read(from: &buf),
timeLastUsed: FfiConverterOptionInt64.read(from: &buf),
timeLastModified: FfiConverterInt64.read(from: &buf),
timesUsed: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: Passport, into buf: inout [UInt8]) {
FfiConverterString.write(value.guid, into: &buf)
FfiConverterString.write(value.name, into: &buf)
FfiConverterString.write(value.country, into: &buf)
FfiConverterString.write(value.passportNumber, into: &buf)
FfiConverterInt64.write(value.issueDateMonth, into: &buf)
FfiConverterInt64.write(value.issueDateDay, into: &buf)
FfiConverterInt64.write(value.issueDateYear, into: &buf)
FfiConverterInt64.write(value.expiryDateMonth, into: &buf)
FfiConverterInt64.write(value.expiryDateDay, into: &buf)
FfiConverterInt64.write(value.expiryDateYear, into: &buf)
FfiConverterInt64.write(value.timeCreated, into: &buf)
FfiConverterOptionInt64.write(value.timeLastUsed, into: &buf)
FfiConverterInt64.write(value.timeLastModified, into: &buf)
FfiConverterInt64.write(value.timesUsed, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypePassport_lift(_ buf: RustBuffer) throws -> Passport {
return try FfiConverterTypePassport.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypePassport_lower(_ value: Passport) -> RustBuffer {
return FfiConverterTypePassport.lower(value)
}
/**
* What you pass to create or update an address.
*/
public struct UpdatableAddressFields: Equatable, Hashable {
public var name: String
public var organization: String
public var streetAddress: String
public var addressLevel3: String
public var addressLevel2: String
public var addressLevel1: String
public var postalCode: String
public var country: String
public var tel: String
public var email: String
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(name: String, organization: String, streetAddress: String, addressLevel3: String, addressLevel2: String, addressLevel1: String, postalCode: String, country: String, tel: String, email: String) {
self.name = name
self.organization = organization
self.streetAddress = streetAddress
self.addressLevel3 = addressLevel3
self.addressLevel2 = addressLevel2
self.addressLevel1 = addressLevel1
self.postalCode = postalCode
self.country = country
self.tel = tel
self.email = email
}
}
#if compiler(>=6)
extension UpdatableAddressFields: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeUpdatableAddressFields: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UpdatableAddressFields {
return
try UpdatableAddressFields(
name: FfiConverterString.read(from: &buf),
organization: FfiConverterString.read(from: &buf),
streetAddress: FfiConverterString.read(from: &buf),
addressLevel3: FfiConverterString.read(from: &buf),
addressLevel2: FfiConverterString.read(from: &buf),
addressLevel1: FfiConverterString.read(from: &buf),
postalCode: FfiConverterString.read(from: &buf),
country: FfiConverterString.read(from: &buf),
tel: FfiConverterString.read(from: &buf),
email: FfiConverterString.read(from: &buf)
)
}
public static func write(_ value: UpdatableAddressFields, into buf: inout [UInt8]) {
FfiConverterString.write(value.name, into: &buf)
FfiConverterString.write(value.organization, into: &buf)
FfiConverterString.write(value.streetAddress, into: &buf)
FfiConverterString.write(value.addressLevel3, into: &buf)
FfiConverterString.write(value.addressLevel2, into: &buf)
FfiConverterString.write(value.addressLevel1, into: &buf)
FfiConverterString.write(value.postalCode, into: &buf)
FfiConverterString.write(value.country, into: &buf)
FfiConverterString.write(value.tel, into: &buf)
FfiConverterString.write(value.email, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableAddressFields_lift(_ buf: RustBuffer) throws -> UpdatableAddressFields {
return try FfiConverterTypeUpdatableAddressFields.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableAddressFields_lower(_ value: UpdatableAddressFields) -> RustBuffer {
return FfiConverterTypeUpdatableAddressFields.lower(value)
}
/**
* An address together with its metadata, passed to `add_address_with_meta` and
* `update_address_with_meta` when importing a record from another store.
*/
public struct UpdatableAddressFieldsWithMeta: Equatable, Hashable {
public var fields: UpdatableAddressFields
public var meta: AddressMeta
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(fields: UpdatableAddressFields, meta: AddressMeta) {
self.fields = fields
self.meta = meta
}
}
#if compiler(>=6)
extension UpdatableAddressFieldsWithMeta: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeUpdatableAddressFieldsWithMeta: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UpdatableAddressFieldsWithMeta {
return
try UpdatableAddressFieldsWithMeta(
fields: FfiConverterTypeUpdatableAddressFields.read(from: &buf),
meta: FfiConverterTypeAddressMeta.read(from: &buf)
)
}
public static func write(_ value: UpdatableAddressFieldsWithMeta, into buf: inout [UInt8]) {
FfiConverterTypeUpdatableAddressFields.write(value.fields, into: &buf)
FfiConverterTypeAddressMeta.write(value.meta, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableAddressFieldsWithMeta_lift(_ buf: RustBuffer) throws -> UpdatableAddressFieldsWithMeta {
return try FfiConverterTypeUpdatableAddressFieldsWithMeta.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableAddressFieldsWithMeta_lower(_ value: UpdatableAddressFieldsWithMeta) -> RustBuffer {
return FfiConverterTypeUpdatableAddressFieldsWithMeta.lower(value)
}
/**
* What you pass to create or update a credit-card. The number is given in
* cleartext; the store encrypts it and derives the last-4 digits itself.
* On update, a null `cc_cvv` keeps the stored CVV and an empty one clears
* it.
*/
public struct UpdatableCreditCardFields: Equatable, Hashable {
public var ccName: String
public var ccNumber: String
public var ccCvv: String?
public var ccExpMonth: Int64
public var ccExpYear: Int64
public var ccType: String
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(ccName: String, ccNumber: String, ccCvv: String? = nil, ccExpMonth: Int64, ccExpYear: Int64, ccType: String) {
self.ccName = ccName
self.ccNumber = ccNumber
self.ccCvv = ccCvv
self.ccExpMonth = ccExpMonth
self.ccExpYear = ccExpYear
self.ccType = ccType
}
}
#if compiler(>=6)
extension UpdatableCreditCardFields: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeUpdatableCreditCardFields: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UpdatableCreditCardFields {
return
try UpdatableCreditCardFields(
ccName: FfiConverterString.read(from: &buf),
ccNumber: FfiConverterString.read(from: &buf),
ccCvv: FfiConverterOptionString.read(from: &buf),
ccExpMonth: FfiConverterInt64.read(from: &buf),
ccExpYear: FfiConverterInt64.read(from: &buf),
ccType: FfiConverterString.read(from: &buf)
)
}
public static func write(_ value: UpdatableCreditCardFields, into buf: inout [UInt8]) {
FfiConverterString.write(value.ccName, into: &buf)
FfiConverterString.write(value.ccNumber, into: &buf)
FfiConverterOptionString.write(value.ccCvv, into: &buf)
FfiConverterInt64.write(value.ccExpMonth, into: &buf)
FfiConverterInt64.write(value.ccExpYear, into: &buf)
FfiConverterString.write(value.ccType, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableCreditCardFields_lift(_ buf: RustBuffer) throws -> UpdatableCreditCardFields {
return try FfiConverterTypeUpdatableCreditCardFields.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableCreditCardFields_lower(_ value: UpdatableCreditCardFields) -> RustBuffer {
return FfiConverterTypeUpdatableCreditCardFields.lower(value)
}
/**
* A credit card together with its metadata, passed to `add_credit_card_with_meta`
* and `update_credit_card_with_meta` when importing a record from another store.
*/
public struct UpdatableCreditCardFieldsWithMeta: Equatable, Hashable {
public var fields: UpdatableCreditCardFields
public var meta: CreditCardMeta
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(fields: UpdatableCreditCardFields, meta: CreditCardMeta) {
self.fields = fields
self.meta = meta
}
}
#if compiler(>=6)
extension UpdatableCreditCardFieldsWithMeta: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeUpdatableCreditCardFieldsWithMeta: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UpdatableCreditCardFieldsWithMeta {
return
try UpdatableCreditCardFieldsWithMeta(
fields: FfiConverterTypeUpdatableCreditCardFields.read(from: &buf),
meta: FfiConverterTypeCreditCardMeta.read(from: &buf)
)
}
public static func write(_ value: UpdatableCreditCardFieldsWithMeta, into buf: inout [UInt8]) {
FfiConverterTypeUpdatableCreditCardFields.write(value.fields, into: &buf)
FfiConverterTypeCreditCardMeta.write(value.meta, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableCreditCardFieldsWithMeta_lift(_ buf: RustBuffer) throws -> UpdatableCreditCardFieldsWithMeta {
return try FfiConverterTypeUpdatableCreditCardFieldsWithMeta.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatableCreditCardFieldsWithMeta_lower(_ value: UpdatableCreditCardFieldsWithMeta) -> RustBuffer {
return FfiConverterTypeUpdatableCreditCardFieldsWithMeta.lower(value)
}
/**
* What you pass to create or update a passport.
*/
public struct UpdatablePassportFields: Equatable, Hashable {
public var name: String
public var country: String
public var passportNumber: String
public var issueDateMonth: Int64
public var issueDateDay: Int64
public var issueDateYear: Int64
public var expiryDateMonth: Int64
public var expiryDateDay: Int64
public var expiryDateYear: Int64
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(name: String, country: String, passportNumber: String, issueDateMonth: Int64, issueDateDay: Int64, issueDateYear: Int64, expiryDateMonth: Int64, expiryDateDay: Int64, expiryDateYear: Int64) {
self.name = name
self.country = country
self.passportNumber = passportNumber
self.issueDateMonth = issueDateMonth
self.issueDateDay = issueDateDay
self.issueDateYear = issueDateYear
self.expiryDateMonth = expiryDateMonth
self.expiryDateDay = expiryDateDay
self.expiryDateYear = expiryDateYear
}
}
#if compiler(>=6)
extension UpdatablePassportFields: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeUpdatablePassportFields: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UpdatablePassportFields {
return
try UpdatablePassportFields(
name: FfiConverterString.read(from: &buf),
country: FfiConverterString.read(from: &buf),
passportNumber: FfiConverterString.read(from: &buf),
issueDateMonth: FfiConverterInt64.read(from: &buf),
issueDateDay: FfiConverterInt64.read(from: &buf),
issueDateYear: FfiConverterInt64.read(from: &buf),
expiryDateMonth: FfiConverterInt64.read(from: &buf),
expiryDateDay: FfiConverterInt64.read(from: &buf),
expiryDateYear: FfiConverterInt64.read(from: &buf)
)
}
public static func write(_ value: UpdatablePassportFields, into buf: inout [UInt8]) {
FfiConverterString.write(value.name, into: &buf)
FfiConverterString.write(value.country, into: &buf)
FfiConverterString.write(value.passportNumber, into: &buf)
FfiConverterInt64.write(value.issueDateMonth, into: &buf)
FfiConverterInt64.write(value.issueDateDay, into: &buf)
FfiConverterInt64.write(value.issueDateYear, into: &buf)
FfiConverterInt64.write(value.expiryDateMonth, into: &buf)
FfiConverterInt64.write(value.expiryDateDay, into: &buf)
FfiConverterInt64.write(value.expiryDateYear, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatablePassportFields_lift(_ buf: RustBuffer) throws -> UpdatablePassportFields {
return try FfiConverterTypeUpdatablePassportFields.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeUpdatablePassportFields_lower(_ value: UpdatablePassportFields) -> RustBuffer {
return FfiConverterTypeUpdatablePassportFields.lower(value)
}
/**
* A bulk insert result entry, returned per input record by `add_many_addresses_with_meta`
*/
public enum AddressBulkResultEntry: Equatable, Hashable {
case success(address: Address
)
case error(message: String
)
}
#if compiler(>=6)
extension AddressBulkResultEntry: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAddressBulkResultEntry: FfiConverterRustBuffer {
typealias SwiftType = AddressBulkResultEntry
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressBulkResultEntry {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .success(address: try FfiConverterTypeAddress.read(from: &buf)
)
case 2: return .error(message: try FfiConverterString.read(from: &buf)
)
default: throw UniffiInternalError.unexpectedEnumCase
}
}
public static func write(_ value: AddressBulkResultEntry, into buf: inout [UInt8]) {
switch value {
case let .success(address):
writeInt(&buf, Int32(1))
FfiConverterTypeAddress.write(address, into: &buf)
case let .error(message):
writeInt(&buf, Int32(2))
FfiConverterString.write(message, into: &buf)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressBulkResultEntry_lift(_ buf: RustBuffer) throws -> AddressBulkResultEntry {
return try FfiConverterTypeAddressBulkResultEntry.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressBulkResultEntry_lower(_ value: AddressBulkResultEntry) -> RustBuffer {
return FfiConverterTypeAddressBulkResultEntry.lower(value)
}
/**
* Per-record result of `add_many_address_tombstones`.
*/
public enum AddressBulkTombstoneResultEntry: Equatable, Hashable {
case success(guid: String
)
case error(message: String
)
}
#if compiler(>=6)
extension AddressBulkTombstoneResultEntry: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAddressBulkTombstoneResultEntry: FfiConverterRustBuffer {
typealias SwiftType = AddressBulkTombstoneResultEntry
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressBulkTombstoneResultEntry {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .success(guid: try FfiConverterString.read(from: &buf)
)
case 2: return .error(message: try FfiConverterString.read(from: &buf)
)
default: throw UniffiInternalError.unexpectedEnumCase
}
}
public static func write(_ value: AddressBulkTombstoneResultEntry, into buf: inout [UInt8]) {
switch value {
case let .success(guid):
writeInt(&buf, Int32(1))
FfiConverterString.write(guid, into: &buf)
case let .error(message):
writeInt(&buf, Int32(2))
FfiConverterString.write(message, into: &buf)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressBulkTombstoneResultEntry_lift(_ buf: RustBuffer) throws -> AddressBulkTombstoneResultEntry {
return try FfiConverterTypeAddressBulkTombstoneResultEntry.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAddressBulkTombstoneResultEntry_lower(_ value: AddressBulkTombstoneResultEntry) -> RustBuffer {
return FfiConverterTypeAddressBulkTombstoneResultEntry.lower(value)
}
public
enum AutofillApiError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {
case SqlError(reason: String
)
case InterruptedError
case CryptoError(reason: String
)
case NoSuchRecord(guid: String
)
case UnexpectedAutofillApiError(reason: String
)
public var errorDescription: String? {
String(reflecting: self)
}
}
#if compiler(>=6)
extension AutofillApiError: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeAutofillApiError: FfiConverterRustBuffer {
typealias SwiftType = AutofillApiError
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AutofillApiError {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .SqlError(
reason: try FfiConverterString.read(from: &buf)
)
case 2: return .InterruptedError
case 3: return .CryptoError(
reason: try FfiConverterString.read(from: &buf)
)
case 4: return .NoSuchRecord(
guid: try FfiConverterString.read(from: &buf)
)
case 5: return .UnexpectedAutofillApiError(
reason: try FfiConverterString.read(from: &buf)
)
default: throw UniffiInternalError.unexpectedEnumCase
}
}
public static func write(_ value: AutofillApiError, into buf: inout [UInt8]) {
switch value {
case let .SqlError(reason):
writeInt(&buf, Int32(1))
FfiConverterString.write(reason, into: &buf)
case .InterruptedError:
writeInt(&buf, Int32(2))
case let .CryptoError(reason):
writeInt(&buf, Int32(3))
FfiConverterString.write(reason, into: &buf)
case let .NoSuchRecord(guid):
writeInt(&buf, Int32(4))
FfiConverterString.write(guid, into: &buf)
case let .UnexpectedAutofillApiError(reason):
writeInt(&buf, Int32(5))
FfiConverterString.write(reason, into: &buf)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAutofillApiError_lift(_ buf: RustBuffer) throws -> AutofillApiError {
return try FfiConverterTypeAutofillApiError.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeAutofillApiError_lower(_ value: AutofillApiError) -> RustBuffer {
return FfiConverterTypeAutofillApiError.lower(value)
}
/**
* A bulk insert result entry, returned per input record by `add_many_credit_cards_with_meta`
*/
public enum CreditCardBulkResultEntry: Equatable, Hashable {
case success(creditCard: CreditCard
)
case error(message: String
)
}
#if compiler(>=6)
extension CreditCardBulkResultEntry: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardBulkResultEntry: FfiConverterRustBuffer {
typealias SwiftType = CreditCardBulkResultEntry
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardBulkResultEntry {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .success(creditCard: try FfiConverterTypeCreditCard.read(from: &buf)
)
case 2: return .error(message: try FfiConverterString.read(from: &buf)
)
default: throw UniffiInternalError.unexpectedEnumCase
}
}
public static func write(_ value: CreditCardBulkResultEntry, into buf: inout [UInt8]) {
switch value {
case let .success(creditCard):
writeInt(&buf, Int32(1))
FfiConverterTypeCreditCard.write(creditCard, into: &buf)
case let .error(message):
writeInt(&buf, Int32(2))
FfiConverterString.write(message, into: &buf)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardBulkResultEntry_lift(_ buf: RustBuffer) throws -> CreditCardBulkResultEntry {
return try FfiConverterTypeCreditCardBulkResultEntry.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardBulkResultEntry_lower(_ value: CreditCardBulkResultEntry) -> RustBuffer {
return FfiConverterTypeCreditCardBulkResultEntry.lower(value)
}
/**
* Per-record result of `add_many_credit_card_tombstones`.
*/
public enum CreditCardBulkTombstoneResultEntry: Equatable, Hashable {
case success(guid: String
)
case error(message: String
)
}
#if compiler(>=6)
extension CreditCardBulkTombstoneResultEntry: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeCreditCardBulkTombstoneResultEntry: FfiConverterRustBuffer {
typealias SwiftType = CreditCardBulkTombstoneResultEntry
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreditCardBulkTombstoneResultEntry {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .success(guid: try FfiConverterString.read(from: &buf)
)
case 2: return .error(message: try FfiConverterString.read(from: &buf)
)
default: throw UniffiInternalError.unexpectedEnumCase
}
}
public static func write(_ value: CreditCardBulkTombstoneResultEntry, into buf: inout [UInt8]) {
switch value {
case let .success(guid):
writeInt(&buf, Int32(1))
FfiConverterString.write(guid, into: &buf)
case let .error(message):
writeInt(&buf, Int32(2))
FfiConverterString.write(message, into: &buf)
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardBulkTombstoneResultEntry_lift(_ buf: RustBuffer) throws -> CreditCardBulkTombstoneResultEntry {
return try FfiConverterTypeCreditCardBulkTombstoneResultEntry.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeCreditCardBulkTombstoneResultEntry_lower(_ value: CreditCardBulkTombstoneResultEntry) -> RustBuffer {
return FfiConverterTypeCreditCardBulkTombstoneResultEntry.lower(value)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterOptionInt64: FfiConverterRustBuffer {
typealias SwiftType = Int64?
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
guard let value = value else {
writeInt(&buf, Int8(0))
return
}
writeInt(&buf, Int8(1))
FfiConverterInt64.write(value, into: &buf)
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
switch try readInt(&buf) as Int8 {
case 0: return nil
case 1: return try FfiConverterInt64.read(from: &buf)
default: throw UniffiInternalError.unexpectedOptionalTag
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterOptionString: FfiConverterRustBuffer {
typealias SwiftType = String?
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
guard let value = value else {
writeInt(&buf, Int8(0))
return
}
writeInt(&buf, Int8(1))
FfiConverterString.write(value, into: &buf)
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
switch try readInt(&buf) as Int8 {
case 0: return nil
case 1: return try FfiConverterString.read(from: &buf)
default: throw UniffiInternalError.unexpectedOptionalTag
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceString: FfiConverterRustBuffer {
typealias SwiftType = [String]
public static func write(_ value: [String], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterString.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String] {
let len: Int32 = try readInt(&buf)
var seq = [String]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterString.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeAddress: FfiConverterRustBuffer {
typealias SwiftType = [Address]
public static func write(_ value: [Address], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeAddress.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Address] {
let len: Int32 = try readInt(&buf)
var seq = [Address]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeAddress.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeAddressTombstone: FfiConverterRustBuffer {
typealias SwiftType = [AddressTombstone]
public static func write(_ value: [AddressTombstone], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeAddressTombstone.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [AddressTombstone] {
let len: Int32 = try readInt(&buf)
var seq = [AddressTombstone]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeAddressTombstone.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeCreditCard: FfiConverterRustBuffer {
typealias SwiftType = [CreditCard]
public static func write(_ value: [CreditCard], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeCreditCard.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [CreditCard] {
let len: Int32 = try readInt(&buf)
var seq = [CreditCard]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeCreditCard.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeCreditCardCandidate: FfiConverterRustBuffer {
typealias SwiftType = [CreditCardCandidate]
public static func write(_ value: [CreditCardCandidate], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeCreditCardCandidate.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [CreditCardCandidate] {
let len: Int32 = try readInt(&buf)
var seq = [CreditCardCandidate]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeCreditCardCandidate.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeCreditCardTombstone: FfiConverterRustBuffer {
typealias SwiftType = [CreditCardTombstone]
public static func write(_ value: [CreditCardTombstone], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeCreditCardTombstone.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [CreditCardTombstone] {
let len: Int32 = try readInt(&buf)
var seq = [CreditCardTombstone]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeCreditCardTombstone.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypePassport: FfiConverterRustBuffer {
typealias SwiftType = [Passport]
public static func write(_ value: [Passport], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypePassport.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Passport] {
let len: Int32 = try readInt(&buf)
var seq = [Passport]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypePassport.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeUpdatableAddressFieldsWithMeta: FfiConverterRustBuffer {
typealias SwiftType = [UpdatableAddressFieldsWithMeta]
public static func write(_ value: [UpdatableAddressFieldsWithMeta], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeUpdatableAddressFieldsWithMeta.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [UpdatableAddressFieldsWithMeta] {
let len: Int32 = try readInt(&buf)
var seq = [UpdatableAddressFieldsWithMeta]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeUpdatableAddressFieldsWithMeta.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeUpdatableCreditCardFieldsWithMeta: FfiConverterRustBuffer {
typealias SwiftType = [UpdatableCreditCardFieldsWithMeta]
public static func write(_ value: [UpdatableCreditCardFieldsWithMeta], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeUpdatableCreditCardFieldsWithMeta.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [UpdatableCreditCardFieldsWithMeta] {
let len: Int32 = try readInt(&buf)
var seq = [UpdatableCreditCardFieldsWithMeta]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeUpdatableCreditCardFieldsWithMeta.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeAddressBulkResultEntry: FfiConverterRustBuffer {
typealias SwiftType = [AddressBulkResultEntry]
public static func write(_ value: [AddressBulkResultEntry], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeAddressBulkResultEntry.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [AddressBulkResultEntry] {
let len: Int32 = try readInt(&buf)
var seq = [AddressBulkResultEntry]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeAddressBulkResultEntry.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeAddressBulkTombstoneResultEntry: FfiConverterRustBuffer {
typealias SwiftType = [AddressBulkTombstoneResultEntry]
public static func write(_ value: [AddressBulkTombstoneResultEntry], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeAddressBulkTombstoneResultEntry.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [AddressBulkTombstoneResultEntry] {
let len: Int32 = try readInt(&buf)
var seq = [AddressBulkTombstoneResultEntry]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeAddressBulkTombstoneResultEntry.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeCreditCardBulkResultEntry: FfiConverterRustBuffer {
typealias SwiftType = [CreditCardBulkResultEntry]
public static func write(_ value: [CreditCardBulkResultEntry], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeCreditCardBulkResultEntry.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [CreditCardBulkResultEntry] {
let len: Int32 = try readInt(&buf)
var seq = [CreditCardBulkResultEntry]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeCreditCardBulkResultEntry.read(from: &buf))
}
return seq
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
fileprivate struct FfiConverterSequenceTypeCreditCardBulkTombstoneResultEntry: FfiConverterRustBuffer {
typealias SwiftType = [CreditCardBulkTombstoneResultEntry]
public static func write(_ value: [CreditCardBulkTombstoneResultEntry], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeCreditCardBulkTombstoneResultEntry.write(item, into: &buf)
}
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [CreditCardBulkTombstoneResultEntry] {
let len: Int32 = try readInt(&buf)
var seq = [CreditCardBulkTombstoneResultEntry]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
seq.append(try FfiConverterTypeCreditCardBulkTombstoneResultEntry.read(from: &buf))
}
return seq
}
}
/**
* Create a new, random, encryption key.
*/
public func createAutofillKey()throws -> String {
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_func_create_autofill_key(uniffiCallStatus
)
})
}
/**
* Create a Store with StaticKeyManager by passing in a db path and a
* static key
*/
public func createAutofillStoreWithStaticKeyManager(path: String, key: String)throws -> Store {
return try FfiConverterTypeStore_lift(try rustCallWithError(FfiConverterTypeAutofillApiError_lift) {
uniffiCallStatus in
uniffi_autofill_fn_func_create_autofill_store_with_static_key_manager(
FfiConverterString.lower(path),
FfiConverterString.lower(key),uniffiCallStatus
)
})
}
private enum InitializationResult {
case ok
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private let initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 30
// Get the scaffolding contract version by calling the into the dylib
let scaffolding_contract_version = ffi_autofill_uniffi_contract_version()
if bindings_contract_version != scaffolding_contract_version {
return InitializationResult.contractVersionMismatch
}
if (uniffi_autofill_checksum_func_create_autofill_key() != 38716) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_func_create_autofill_store_with_static_key_manager() != 23621) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_apply() != 22429) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_ensure_current_sync_id() != 44860) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_last_sync() != 60618) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_reset() != 32130) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_reset_sync_id() != 61259) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_set_uploaded() != 44509) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_store_incoming() != 41524) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_sync_finished() != 34855) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_sync_id() != 34389) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_sync_started() != 54649) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_addressesbridgedengine_wipe() != 15663) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_apply() != 65106) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_ensure_current_sync_id() != 17118) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_last_sync() != 25901) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_reset() != 15504) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_reset_sync_id() != 14075) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_set_uploaded() != 65209) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_store_incoming() != 59724) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_sync_finished() != 9079) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_sync_id() != 58554) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_sync_started() != 42536) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_creditcardsbridgedengine_wipe() != 37047) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_address() != 29340) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_address_with_meta() != 27061) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_credit_card() != 39831) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_credit_card_with_meta() != 12334) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_many_address_tombstones() != 50580) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_many_addresses_with_meta() != 7513) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_many_credit_card_tombstones() != 7008) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_many_credit_cards_with_meta() != 13714) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_add_passport() != 41691) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_addresses_bridged_engine() != 56264) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_count_all_addresses() != 51483) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_count_all_credit_cards() != 16961) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_count_all_passports() != 5277) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_credit_cards_bridged_engine() != 37935) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_delete_address() != 63199) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_delete_all_addresses() != 25310) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_delete_all_credit_cards() != 37337) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_delete_credit_card() != 33261) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_delete_passport() != 36583) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_get_address() != 1991) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_get_all_addresses() != 9297) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_get_all_credit_cards() != 19499) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_get_all_passports() != 59270) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_get_credit_card() != 31148) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_get_passport() != 57057) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_list_credit_card_candidates() != 44672) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_register_with_sync_manager() != 50761) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_run_maintenance() != 61934) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_scrub_encrypted_data() != 13990) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_scrub_undecryptable_credit_card_data_for_remote_replacement() != 27462) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_shutdown() != 46136) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_touch_address() != 31779) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_touch_credit_card() != 11199) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_touch_passport() != 39386) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_update_address() != 21288) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_update_address_with_meta() != 17897) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_update_credit_card() != 23488) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_update_credit_card_with_meta() != 33534) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_method_store_update_passport() != 64688) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_autofill_checksum_constructor_store_new() != 20484) {
return InitializationResult.apiChecksumMismatch
}
uniffiEnsureDbCryptoInitialized()
return InitializationResult.ok
}()
// Make the ensure init function public so that other modules which have external type references to
// our types can call it.
public func uniffiEnsureAutofillInitialized() {
switch initializationResult {
case .ok:
break
case .contractVersionMismatch:
fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
case .apiChecksumMismatch:
fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
}
// swiftlint:enable all