diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 1816fb3..0b0bcda 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -21,7 +21,7 @@ thiserror = "1.0.38" uniffi = "0.27.1" [build-dependencies] -uniffi = { version = "0.26.1", features = [ "build" ] } +uniffi = { version = "0.27.1", features = [ "build" ] } [lib] name = "uniffi_yniffi" diff --git a/lib/swift/scaffold/yniffi.swift b/lib/swift/scaffold/yniffi.swift index d51d3e5..0978308 100644 --- a/lib/swift/scaffold/yniffi.swift +++ b/lib/swift/scaffold/yniffi.swift @@ -1,5 +1,7 @@ // 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 @@ -18,6 +20,10 @@ private extension RustBuffer { 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) -> RustBuffer { try! rustCall { ffi_uniffi_yniffi_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } } @@ -221,9 +227,17 @@ private enum UniffiInternalError: LocalizedError { } } +private extension NSLock { + func withLock(f: () throws -> T) rethrows -> T { + lock() + defer { self.unlock() } + return try f() + } +} + private let CALL_SUCCESS: Int8 = 0 private let CALL_ERROR: Int8 = 1 -private let CALL_PANIC: Int8 = 2 +private let CALL_UNEXPECTED_ERROR: Int8 = 2 private let CALL_CANCELLED: Int8 = 3 private extension RustCallStatus { @@ -277,7 +291,7 @@ private func uniffiCheckCallStatus( throw UniffiInternalError.unexpectedRustCallError } - case CALL_PANIC: + 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. @@ -296,6 +310,74 @@ private func uniffiCheckCallStatus( } } +private func uniffiTraitInterfaceCall( + callStatus: UnsafeMutablePointer, + makeCall: () throws -> T, + writeReturn: (T) -> Void +) { + do { + try writeReturn(makeCall()) + } catch { + callStatus.pointee.code = CALL_UNEXPECTED_ERROR + callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + } +} + +private func uniffiTraitInterfaceCallWithError( + callStatus: UnsafeMutablePointer, + makeCall: () throws -> T, + writeReturn: (T) -> Void, + 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)) + } +} + +private class UniffiHandleMap { + private var map: [UInt64: T] = [:] + private let lock = NSLock() + private var currentHandle: UInt64 = 1 + + func insert(obj: T) -> UInt64 { + lock.withLock { + let handle = currentHandle + currentHandle += 1 + 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 + } + } + + @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 { + map.count + } +} + // Public interface members begin here. private struct FfiConverterUInt8: FfiConverterPrimitive { @@ -398,23 +480,43 @@ private struct FfiConverterString: FfiConverter { public protocol YSubscriptionProtocol: AnyObject {} -public class YSubscription: +open class YSubscription: YSubscriptionProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_ysubscription(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_ysubscription(pointer, $0) } } } @@ -483,139 +585,131 @@ public protocol YrsArrayProtocol: AnyObject { func toA(tx: YrsTransaction) -> [String] } -public class YrsArray: +open class YrsArray: YrsArrayProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrsarray(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrsarray(pointer, $0) } } - public func each(tx: YrsTransaction, delegate: YrsArrayEachDelegate) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_each(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterCallbackInterfaceYrsArrayEachDelegate.lower(delegate), $0) - } + open func each(tx: YrsTransaction, delegate: YrsArrayEachDelegate) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_each(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterCallbackInterfaceYrsArrayEachDelegate.lower(delegate), $0) + } } - public func get(tx: YrsTransaction, index: UInt32) throws -> String { - return try FfiConverterString.lift( - rustCallWithError(FfiConverterTypeCodingError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsarray_get(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), $0) - } - ) + open func get(tx: YrsTransaction, index: UInt32) throws -> String { + return try FfiConverterString.lift(rustCallWithError(FfiConverterTypeCodingError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsarray_get(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), $0) + }) } - public func insert(tx: YrsTransaction, index: UInt32, value: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_insert(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterString.lower(value), $0) - } + open func insert(tx: YrsTransaction, index: UInt32, value: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_insert(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterString.lower(value), $0) + } } - public func insertRange(tx: YrsTransaction, index: UInt32, values: [String]) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_insert_range(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterSequenceString.lower(values), $0) - } + open func insertRange(tx: YrsTransaction, index: UInt32, values: [String]) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_insert_range(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterSequenceString.lower(values), $0) + } } - public func length(tx: YrsTransaction) -> UInt32 { - return try! FfiConverterUInt32.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_length(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), $0) - } - ) + open func length(tx: YrsTransaction) -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_length(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), $0) + }) } - public func observe(delegate: YrsArrayObservationDelegate) -> YSubscription { - return try! FfiConverterTypeYSubscription.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_observe(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceYrsArrayObservationDelegate.lower(delegate), $0) - } - ) + open func observe(delegate: YrsArrayObservationDelegate) -> YSubscription { + return try! FfiConverterTypeYSubscription.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_observe(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceYrsArrayObservationDelegate.lower(delegate), $0) + }) } - public func pushBack(tx: YrsTransaction, value: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_push_back(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(value), $0) - } + open func pushBack(tx: YrsTransaction, value: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_push_back(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(value), $0) + } } - public func pushFront(tx: YrsTransaction, value: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_push_front(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(value), $0) - } + open func pushFront(tx: YrsTransaction, value: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_push_front(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(value), $0) + } } - public func rawPtr() -> YrsCollectionPtr { - return try! FfiConverterTypeYrsCollectionPtr.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_raw_ptr(self.uniffiClonePointer(), $0) - } - ) + open func rawPtr() -> YrsCollectionPtr { + return try! FfiConverterTypeYrsCollectionPtr.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_raw_ptr(self.uniffiClonePointer(), $0) + }) } - public func remove(tx: YrsTransaction, index: UInt32) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_remove(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), $0) - } + open func remove(tx: YrsTransaction, index: UInt32) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_remove(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), $0) + } } - public func removeRange(tx: YrsTransaction, index: UInt32, len: UInt32) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_remove_range(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterUInt32.lower(len), $0) - } + open func removeRange(tx: YrsTransaction, index: UInt32, len: UInt32) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_remove_range(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterUInt32.lower(len), $0) + } } - public func toA(tx: YrsTransaction) -> [String] { - return try! FfiConverterSequenceString.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsarray_to_a(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), $0) - } - ) + open func toA(tx: YrsTransaction) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsarray_to_a(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), $0) + }) } } @@ -671,90 +765,94 @@ public protocol YrsDocProtocol: AnyObject { func undoManager(trackedRefs: [YrsCollectionPtr]) -> YrsUndoManager } -public class YrsDoc: +open class YrsDoc: YrsDocProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrsdoc(self.pointer, $0) } } public convenience init() { - self.init(unsafeFromRawPointer: try! rustCall { - uniffi_uniffi_yniffi_fn_constructor_yrsdoc_new($0) - }) + let pointer = + try! rustCall { + uniffi_uniffi_yniffi_fn_constructor_yrsdoc_new($0 + ) + } + self.init(unsafeFromRawPointer: pointer) } deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrsdoc(pointer, $0) } } - public func encodeDiffV1(tx: YrsTransaction, stateVector: [UInt8]) throws -> [UInt8] { - return try FfiConverterSequenceUInt8.lift( - rustCallWithError(FfiConverterTypeCodingError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsdoc_encode_diff_v1(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterSequenceUInt8.lower(stateVector), $0) - } - ) + open func encodeDiffV1(tx: YrsTransaction, stateVector: [UInt8]) throws -> [UInt8] { + return try FfiConverterSequenceUInt8.lift(rustCallWithError(FfiConverterTypeCodingError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsdoc_encode_diff_v1(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterSequenceUInt8.lower(stateVector), $0) + }) } - public func getArray(name: String) -> YrsArray { - return try! FfiConverterTypeYrsArray.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsdoc_get_array(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - } - ) + open func getArray(name: String) -> YrsArray { + return try! FfiConverterTypeYrsArray.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsdoc_get_array(self.uniffiClonePointer(), + FfiConverterString.lower(name), $0) + }) } - public func getMap(name: String) -> YrsMap { - return try! FfiConverterTypeYrsMap.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsdoc_get_map(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - } - ) + open func getMap(name: String) -> YrsMap { + return try! FfiConverterTypeYrsMap.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsdoc_get_map(self.uniffiClonePointer(), + FfiConverterString.lower(name), $0) + }) } - public func getText(name: String) -> YrsText { - return try! FfiConverterTypeYrsText.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsdoc_get_text(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - } - ) + open func getText(name: String) -> YrsText { + return try! FfiConverterTypeYrsText.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsdoc_get_text(self.uniffiClonePointer(), + FfiConverterString.lower(name), $0) + }) } - public func transact(origin: YrsOrigin?) -> YrsTransaction { - return try! FfiConverterTypeYrsTransaction.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsdoc_transact(self.uniffiClonePointer(), - FfiConverterOptionTypeYrsOrigin.lower(origin), $0) - } - ) + open func transact(origin: YrsOrigin?) -> YrsTransaction { + return try! FfiConverterTypeYrsTransaction.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsdoc_transact(self.uniffiClonePointer(), + FfiConverterOptionTypeYrsOrigin.lower(origin), $0) + }) } - public func undoManager(trackedRefs: [YrsCollectionPtr]) -> YrsUndoManager { - return try! FfiConverterTypeYrsUndoManager.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsdoc_undo_manager(self.uniffiClonePointer(), - FfiConverterSequenceTypeYrsCollectionPtr.lower(trackedRefs), $0) - } - ) + open func undoManager(trackedRefs: [YrsCollectionPtr]) -> YrsUndoManager { + return try! FfiConverterTypeYrsUndoManager.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsdoc_undo_manager(self.uniffiClonePointer(), + FfiConverterSequenceTypeYrsCollectionPtr.lower(trackedRefs), $0) + }) } } @@ -820,129 +918,123 @@ public protocol YrsMapProtocol: AnyObject { func values(tx: YrsTransaction, delegate: YrsMapIteratorDelegate) } -public class YrsMap: +open class YrsMap: YrsMapProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrsmap(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrsmap(pointer, $0) } } - public func clear(tx: YrsTransaction) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_clear(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), $0) - } + open func clear(tx: YrsTransaction) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_clear(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), $0) + } } - public func containsKey(tx: YrsTransaction, key: String) -> Bool { - return try! FfiConverterBool.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_contains_key(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(key), $0) - } - ) + open func containsKey(tx: YrsTransaction, key: String) -> Bool { + return try! FfiConverterBool.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_contains_key(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(key), $0) + }) } - public func each(tx: YrsTransaction, delegate: YrsMapKvIteratorDelegate) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_each(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate.lower(delegate), $0) - } + open func each(tx: YrsTransaction, delegate: YrsMapKvIteratorDelegate) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_each(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate.lower(delegate), $0) + } } - public func get(tx: YrsTransaction, key: String) throws -> String { - return try FfiConverterString.lift( - rustCallWithError(FfiConverterTypeCodingError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsmap_get(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(key), $0) - } - ) + open func get(tx: YrsTransaction, key: String) throws -> String { + return try FfiConverterString.lift(rustCallWithError(FfiConverterTypeCodingError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsmap_get(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(key), $0) + }) } - public func insert(tx: YrsTransaction, key: String, value: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_insert(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(key), - FfiConverterString.lower(value), $0) - } + open func insert(tx: YrsTransaction, key: String, value: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_insert(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(key), + FfiConverterString.lower(value), $0) + } } - public func keys(tx: YrsTransaction, delegate: YrsMapIteratorDelegate) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_keys(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterCallbackInterfaceYrsMapIteratorDelegate.lower(delegate), $0) - } + open func keys(tx: YrsTransaction, delegate: YrsMapIteratorDelegate) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_keys(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterCallbackInterfaceYrsMapIteratorDelegate.lower(delegate), $0) + } } - public func length(tx: YrsTransaction) -> UInt32 { - return try! FfiConverterUInt32.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_length(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), $0) - } - ) + open func length(tx: YrsTransaction) -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_length(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), $0) + }) } - public func observe(delegate: YrsMapObservationDelegate) -> YSubscription { - return try! FfiConverterTypeYSubscription.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_observe(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceYrsMapObservationDelegate.lower(delegate), $0) - } - ) + open func observe(delegate: YrsMapObservationDelegate) -> YSubscription { + return try! FfiConverterTypeYSubscription.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_observe(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceYrsMapObservationDelegate.lower(delegate), $0) + }) } - public func rawPtr() -> YrsCollectionPtr { - return try! FfiConverterTypeYrsCollectionPtr.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_raw_ptr(self.uniffiClonePointer(), $0) - } - ) + open func rawPtr() -> YrsCollectionPtr { + return try! FfiConverterTypeYrsCollectionPtr.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_raw_ptr(self.uniffiClonePointer(), $0) + }) } - public func remove(tx: YrsTransaction, key: String) throws -> String? { - return try FfiConverterOptionString.lift( - rustCallWithError(FfiConverterTypeCodingError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsmap_remove(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(key), $0) - } - ) + open func remove(tx: YrsTransaction, key: String) throws -> String? { + return try FfiConverterOptionString.lift(rustCallWithError(FfiConverterTypeCodingError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsmap_remove(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(key), $0) + }) } - public func values(tx: YrsTransaction, delegate: YrsMapIteratorDelegate) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsmap_values(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterCallbackInterfaceYrsMapIteratorDelegate.lower(delegate), $0) - } + open func values(tx: YrsTransaction, delegate: YrsMapIteratorDelegate) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsmap_values(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterCallbackInterfaceYrsMapIteratorDelegate.lower(delegate), $0) + } } } @@ -1008,135 +1100,129 @@ public protocol YrsTextProtocol: AnyObject { func removeRange(tx: YrsTransaction, start: UInt32, length: UInt32) } -public class YrsText: +open class YrsText: YrsTextProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrstext(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrstext(pointer, $0) } } - public func append(tx: YrsTransaction, text: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_append(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterString.lower(text), $0) - } + open func append(tx: YrsTransaction, text: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_append(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterString.lower(text), $0) + } } - public func format(tx: YrsTransaction, index: UInt32, length: UInt32, attrs: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_format(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterUInt32.lower(length), - FfiConverterString.lower(attrs), $0) - } + open func format(tx: YrsTransaction, index: UInt32, length: UInt32, attrs: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_format(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterUInt32.lower(length), + FfiConverterString.lower(attrs), $0) + } } - public func getString(tx: YrsTransaction) -> String { - return try! FfiConverterString.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_get_string(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), $0) - } - ) + open func getString(tx: YrsTransaction) -> String { + return try! FfiConverterString.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_get_string(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), $0) + }) } - public func insert(tx: YrsTransaction, index: UInt32, chunk: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_insert(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterString.lower(chunk), $0) - } + open func insert(tx: YrsTransaction, index: UInt32, chunk: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_insert(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterString.lower(chunk), $0) + } } - public func insertEmbed(tx: YrsTransaction, index: UInt32, content: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_insert_embed(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterString.lower(content), $0) - } + open func insertEmbed(tx: YrsTransaction, index: UInt32, content: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_insert_embed(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterString.lower(content), $0) + } } - public func insertEmbedWithAttributes(tx: YrsTransaction, index: UInt32, content: String, attrs: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_insert_embed_with_attributes(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterString.lower(content), - FfiConverterString.lower(attrs), $0) - } + open func insertEmbedWithAttributes(tx: YrsTransaction, index: UInt32, content: String, attrs: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_insert_embed_with_attributes(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterString.lower(content), + FfiConverterString.lower(attrs), $0) + } } - public func insertWithAttributes(tx: YrsTransaction, index: UInt32, chunk: String, attrs: String) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_insert_with_attributes(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(index), - FfiConverterString.lower(chunk), - FfiConverterString.lower(attrs), $0) - } + open func insertWithAttributes(tx: YrsTransaction, index: UInt32, chunk: String, attrs: String) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_insert_with_attributes(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(index), + FfiConverterString.lower(chunk), + FfiConverterString.lower(attrs), $0) + } } - public func length(tx: YrsTransaction) -> UInt32 { - return try! FfiConverterUInt32.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_length(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), $0) - } - ) + open func length(tx: YrsTransaction) -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_length(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), $0) + }) } - public func observe(delegate: YrsTextObservationDelegate) -> YSubscription { - return try! FfiConverterTypeYSubscription.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_observe(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceYrsTextObservationDelegate.lower(delegate), $0) - } - ) + open func observe(delegate: YrsTextObservationDelegate) -> YSubscription { + return try! FfiConverterTypeYSubscription.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_observe(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceYrsTextObservationDelegate.lower(delegate), $0) + }) } - public func rawPtr() -> YrsCollectionPtr { - return try! FfiConverterTypeYrsCollectionPtr.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_raw_ptr(self.uniffiClonePointer(), $0) - } - ) + open func rawPtr() -> YrsCollectionPtr { + return try! FfiConverterTypeYrsCollectionPtr.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_raw_ptr(self.uniffiClonePointer(), $0) + }) } - public func removeRange(tx: YrsTransaction, start: UInt32, length: UInt32) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstext_remove_range(self.uniffiClonePointer(), - FfiConverterTypeYrsTransaction.lower(tx), - FfiConverterUInt32.lower(start), - FfiConverterUInt32.lower(length), $0) - } + open func removeRange(tx: YrsTransaction, start: UInt32, length: UInt32) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstext_remove_range(self.uniffiClonePointer(), + FfiConverterTypeYrsTransaction.lower(tx), + FfiConverterUInt32.lower(start), + FfiConverterUInt32.lower(length), $0) + } } } @@ -1200,114 +1286,107 @@ public protocol YrsTransactionProtocol: AnyObject { func transactionStateVector() -> [UInt8] } -public class YrsTransaction: +open class YrsTransaction: YrsTransactionProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrstransaction(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrstransaction(pointer, $0) } } - public func free() { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_free(self.uniffiClonePointer(), $0) - } + open func free() { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_free(self.uniffiClonePointer(), $0) + } } - public func origin() -> YrsOrigin? { - return try! FfiConverterOptionTypeYrsOrigin.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_origin(self.uniffiClonePointer(), $0) - } - ) + open func origin() -> YrsOrigin? { + return try! FfiConverterOptionTypeYrsOrigin.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_origin(self.uniffiClonePointer(), $0) + }) } - public func transactionApplyUpdate(update: [UInt8]) throws { - try - rustCallWithError(FfiConverterTypeCodingError.lift) { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_apply_update(self.uniffiClonePointer(), - FfiConverterSequenceUInt8.lower(update), $0) - } + open func transactionApplyUpdate(update: [UInt8]) throws { try rustCallWithError(FfiConverterTypeCodingError.lift) { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_apply_update(self.uniffiClonePointer(), + FfiConverterSequenceUInt8.lower(update), $0) + } } - public func transactionEncodeStateAsUpdate() -> [UInt8] { - return try! FfiConverterSequenceUInt8.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_state_as_update(self.uniffiClonePointer(), $0) - } - ) + open func transactionEncodeStateAsUpdate() -> [UInt8] { + return try! FfiConverterSequenceUInt8.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_state_as_update(self.uniffiClonePointer(), $0) + }) } - public func transactionEncodeStateAsUpdateFromSv(stateVector: [UInt8]) throws -> [UInt8] { - return try FfiConverterSequenceUInt8.lift( - rustCallWithError(FfiConverterTypeCodingError.lift) { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_state_as_update_from_sv(self.uniffiClonePointer(), - FfiConverterSequenceUInt8.lower(stateVector), $0) - } - ) + open func transactionEncodeStateAsUpdateFromSv(stateVector: [UInt8]) throws -> [UInt8] { + return try FfiConverterSequenceUInt8.lift(rustCallWithError(FfiConverterTypeCodingError.lift) { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_state_as_update_from_sv(self.uniffiClonePointer(), + FfiConverterSequenceUInt8.lower(stateVector), $0) + }) } - public func transactionEncodeUpdate() -> [UInt8] { - return try! FfiConverterSequenceUInt8.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_update(self.uniffiClonePointer(), $0) - } - ) + open func transactionEncodeUpdate() -> [UInt8] { + return try! FfiConverterSequenceUInt8.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_update(self.uniffiClonePointer(), $0) + }) } - public func transactionGetArray(name: String) -> YrsArray? { - return try! FfiConverterOptionTypeYrsArray.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_array(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - } - ) + open func transactionGetArray(name: String) -> YrsArray? { + return try! FfiConverterOptionTypeYrsArray.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_array(self.uniffiClonePointer(), + FfiConverterString.lower(name), $0) + }) } - public func transactionGetMap(name: String) -> YrsMap? { - return try! FfiConverterOptionTypeYrsMap.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_map(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - } - ) + open func transactionGetMap(name: String) -> YrsMap? { + return try! FfiConverterOptionTypeYrsMap.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_map(self.uniffiClonePointer(), + FfiConverterString.lower(name), $0) + }) } - public func transactionGetText(name: String) -> YrsText? { - return try! FfiConverterOptionTypeYrsText.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_text(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - } - ) + open func transactionGetText(name: String) -> YrsText? { + return try! FfiConverterOptionTypeYrsText.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_text(self.uniffiClonePointer(), + FfiConverterString.lower(name), $0) + }) } - public func transactionStateVector() -> [UInt8] { - return try! FfiConverterSequenceUInt8.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_state_vector(self.uniffiClonePointer(), $0) - } - ) + open func transactionStateVector() -> [UInt8] { + return try! FfiConverterSequenceUInt8.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_state_vector(self.uniffiClonePointer(), $0) + }) } } @@ -1357,52 +1436,63 @@ public protocol YrsUndoEventProtocol: AnyObject { func origin() -> YrsOrigin? } -public class YrsUndoEvent: +open class YrsUndoEvent: YrsUndoEventProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrsundoevent(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrsundoevent(pointer, $0) } } - public func hasChanged(sharedRef: YrsCollectionPtr) -> Bool { - return try! FfiConverterBool.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundoevent_has_changed(self.uniffiClonePointer(), - FfiConverterTypeYrsCollectionPtr.lower(sharedRef), $0) - } - ) + open func hasChanged(sharedRef: YrsCollectionPtr) -> Bool { + return try! FfiConverterBool.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundoevent_has_changed(self.uniffiClonePointer(), + FfiConverterTypeYrsCollectionPtr.lower(sharedRef), $0) + }) } - public func kind() -> YrsUndoEventKind { - return try! FfiConverterTypeYrsUndoEventKind.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundoevent_kind(self.uniffiClonePointer(), $0) - } - ) + open func kind() -> YrsUndoEventKind { + return try! FfiConverterTypeYrsUndoEventKind.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundoevent_kind(self.uniffiClonePointer(), $0) + }) } - public func origin() -> YrsOrigin? { - return try! FfiConverterOptionTypeYrsOrigin.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundoevent_origin(self.uniffiClonePointer(), $0) - } - ) + open func origin() -> YrsOrigin? { + return try! FfiConverterOptionTypeYrsOrigin.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundoevent_origin(self.uniffiClonePointer(), $0) + }) } } @@ -1504,23 +1594,43 @@ public protocol YrsUndoManagerProtocol: AnyObject { * A manager type able to track changes occurring in a context of a given document. * These changes can be reverted using `undo` method call, or re-applied via `redo`. */ -public class YrsUndoManager: +open class YrsUndoManager: YrsUndoManagerProtocol { - fileprivate let pointer: UnsafeMutableRawPointer + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + public struct NoPointer { + 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`. - required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } + /// This constructor can be used to instantiate a fake object. + /// - Parameter noPointer: 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 [Pointer] the FFI lower functions will crash. + public init(noPointer _: NoPointer) { + pointer = nil + } + public func uniffiClonePointer() -> UnsafeMutableRawPointer { return try! rustCall { uniffi_uniffi_yniffi_fn_clone_yrsundomanager(self.pointer, $0) } } + // No primary constructor declared for this class. + deinit { + guard let pointer = pointer else { + return + } + try! rustCall { uniffi_uniffi_yniffi_fn_free_yrsundomanager(pointer, $0) } } @@ -1529,63 +1639,48 @@ public class YrsUndoManager: * origin list is not empty, current undo manager will only track changes applied * over transactions created with a specific origin. */ - public func addOrigin(origin: YrsOrigin) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_add_origin(self.uniffiClonePointer(), - FfiConverterTypeYrsOrigin.lower(origin), $0) - } + open func addOrigin(origin: YrsOrigin) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_add_origin(self.uniffiClonePointer(), + FfiConverterTypeYrsOrigin.lower(origin), $0) + } } /** * Adds a new shared collection to a list of entities observed by current undo manager. */ - public func addScope(trackedRef: YrsCollectionPtr) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_add_scope(self.uniffiClonePointer(), - FfiConverterTypeYrsCollectionPtr.lower(trackedRef), $0) - } + open func addScope(trackedRef: YrsCollectionPtr) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_add_scope(self.uniffiClonePointer(), + FfiConverterTypeYrsCollectionPtr.lower(trackedRef), $0) + } } /** * Clears the undo/redo stacks of a current undo manager. */ - public func clear() throws { - try - rustCallWithError(FfiConverterTypeYrsUndoError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_clear(self.uniffiClonePointer(), $0) - } + open func clear() throws { try rustCallWithError(FfiConverterTypeYrsUndoError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_clear(self.uniffiClonePointer(), $0) + } } - public func observeAdded(delegate: YrsUndoManagerObservationDelegate) -> YSubscription { - return try! FfiConverterTypeYSubscription.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_added(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.lower(delegate), $0) - } - ) + open func observeAdded(delegate: YrsUndoManagerObservationDelegate) -> YSubscription { + return try! FfiConverterTypeYSubscription.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_added(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.lower(delegate), $0) + }) } - public func observePopped(delegate: YrsUndoManagerObservationDelegate) -> YSubscription { - return try! FfiConverterTypeYSubscription.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_popped(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.lower(delegate), $0) - } - ) + open func observePopped(delegate: YrsUndoManagerObservationDelegate) -> YSubscription { + return try! FfiConverterTypeYSubscription.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_popped(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.lower(delegate), $0) + }) } - public func observeUpdated(delegate: YrsUndoManagerObservationDelegate) -> YSubscription { - return try! FfiConverterTypeYSubscription.lift( - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_updated(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.lower(delegate), $0) - } - ) + open func observeUpdated(delegate: YrsUndoManagerObservationDelegate) -> YSubscription { + return try! FfiConverterTypeYSubscription.lift(try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_updated(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.lower(delegate), $0) + }) } /** @@ -1593,12 +1688,10 @@ public class YrsUndoManager: * empty an method had no effect. * Fails to execute if there's another transaction in progress. */ - public func redo() throws -> Bool { - return try FfiConverterBool.lift( - rustCallWithError(FfiConverterTypeYrsUndoError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_redo(self.uniffiClonePointer(), $0) - } - ) + open func redo() throws -> Bool { + return try FfiConverterBool.lift(rustCallWithError(FfiConverterTypeYrsUndoError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_redo(self.uniffiClonePointer(), $0) + }) } /** @@ -1606,12 +1699,10 @@ public class YrsUndoManager: * origin list is not empty, current undo manager will only track changes applied * over transactions created with a specific origin. */ - public func removeOrigin(origin: YrsOrigin) { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_remove_origin(self.uniffiClonePointer(), - FfiConverterTypeYrsOrigin.lower(origin), $0) - } + open func removeOrigin(origin: YrsOrigin) { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_remove_origin(self.uniffiClonePointer(), + FfiConverterTypeYrsOrigin.lower(origin), $0) + } } /** @@ -1619,23 +1710,19 @@ public class YrsUndoManager: * stack was empty an method had no effect. * Fails to execute if there's another transaction in progress. */ - public func undo() throws -> Bool { - return try FfiConverterBool.lift( - rustCallWithError(FfiConverterTypeYrsUndoError.lift) { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_undo(self.uniffiClonePointer(), $0) - } - ) + open func undo() throws -> Bool { + return try FfiConverterBool.lift(rustCallWithError(FfiConverterTypeYrsUndoError.lift) { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_undo(self.uniffiClonePointer(), $0) + }) } /** * Wraps a set of recent changes together into a single undo operation. These * changes will be be undone together on the next `undo` method call. */ - public func wrapChanges() { - try! - rustCall { - uniffi_uniffi_yniffi_fn_method_yrsundomanager_wrap_changes(self.uniffiClonePointer(), $0) - } + open func wrapChanges() { try! rustCall { + uniffi_uniffi_yniffi_fn_method_yrsundomanager_wrap_changes(self.uniffiClonePointer(), $0) + } } } @@ -1683,10 +1770,7 @@ public struct YrsMapChange { // Default memberwise initializers are never public by default, so we // declare one manually. - public init( - key: String, - change: YrsEntryChange - ) { + public init(key: String, change: YrsEntryChange) { self.key = key self.change = change } @@ -1736,10 +1820,6 @@ public enum CodingError { case EncodingError(message: String) case DecodingError(message: String) - - fileprivate static func uniffiErrorHandler(_ error: RustBuffer) throws -> Error { - return try FfiConverterTypeCodingError.lift(error) - } } public struct FfiConverterTypeCodingError: FfiConverterRustBuffer { @@ -1776,15 +1856,13 @@ extension CodingError: Error {} // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. + public enum YrsChange { - case added( - elements: [String] + case added(elements: [String] ) - case removed( - range: UInt32 + case removed(range: UInt32 ) - case retained( - range: UInt32 + case retained(range: UInt32 ) } @@ -1794,16 +1872,13 @@ public struct FfiConverterTypeYrsChange: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> YrsChange { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .added( - elements: FfiConverterSequenceString.read(from: &buf) + case 1: return try .added(elements: FfiConverterSequenceString.read(from: &buf) ) - case 2: return try .removed( - range: FfiConverterUInt32.read(from: &buf) + case 2: return try .removed(range: FfiConverterUInt32.read(from: &buf) ) - case 3: return try .retained( - range: FfiConverterUInt32.read(from: &buf) + case 3: return try .retained(range: FfiConverterUInt32.read(from: &buf) ) default: throw UniffiInternalError.unexpectedEnumCase @@ -1839,18 +1914,12 @@ extension YrsChange: Equatable, Hashable {} // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. + public enum YrsDelta { - case inserted( - value: String, - attrs: String - ) - case deleted( - index: UInt32 - ) - case retained( - index: UInt32, - attrs: String + case inserted(value: String, attrs: String) + case deleted(index: UInt32 ) + case retained(index: UInt32, attrs: String) } public struct FfiConverterTypeYrsDelta: FfiConverterRustBuffer { @@ -1859,19 +1928,12 @@ public struct FfiConverterTypeYrsDelta: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> YrsDelta { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .inserted( - value: FfiConverterString.read(from: &buf), - attrs: FfiConverterString.read(from: &buf) - ) + case 1: return try .inserted(value: FfiConverterString.read(from: &buf), attrs: FfiConverterString.read(from: &buf)) - case 2: return try .deleted( - index: FfiConverterUInt32.read(from: &buf) + case 2: return try .deleted(index: FfiConverterUInt32.read(from: &buf) ) - case 3: return try .retained( - index: FfiConverterUInt32.read(from: &buf), - attrs: FfiConverterString.read(from: &buf) - ) + case 3: return try .retained(index: FfiConverterUInt32.read(from: &buf), attrs: FfiConverterString.read(from: &buf)) default: throw UniffiInternalError.unexpectedEnumCase } @@ -1908,16 +1970,12 @@ extension YrsDelta: Equatable, Hashable {} // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. + public enum YrsEntryChange { - case inserted( - value: String - ) - case updated( - oldValue: String, - newValue: String + case inserted(value: String ) - case removed( - value: String + case updated(oldValue: String, newValue: String) + case removed(value: String ) } @@ -1927,17 +1985,12 @@ public struct FfiConverterTypeYrsEntryChange: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> YrsEntryChange { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .inserted( - value: FfiConverterString.read(from: &buf) + case 1: return try .inserted(value: FfiConverterString.read(from: &buf) ) - case 2: return try .updated( - oldValue: FfiConverterString.read(from: &buf), - newValue: FfiConverterString.read(from: &buf) - ) + case 2: return try .updated(oldValue: FfiConverterString.read(from: &buf), newValue: FfiConverterString.read(from: &buf)) - case 3: return try .removed( - value: FfiConverterString.read(from: &buf) + case 3: return try .removed(value: FfiConverterString.read(from: &buf) ) default: throw UniffiInternalError.unexpectedEnumCase @@ -1974,10 +2027,6 @@ extension YrsEntryChange: Equatable, Hashable {} public enum YrsUndoError { case PendingTransaction(message: String) - - fileprivate static func uniffiErrorHandler(_ error: RustBuffer) throws -> Error { - return try FfiConverterTypeYrsUndoError.lift(error) - } } public struct FfiConverterTypeYrsUndoError: FfiConverterRustBuffer { @@ -2008,6 +2057,7 @@ extension YrsUndoError: Error {} // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. + public enum YrsUndoEventKind { case undo case redo @@ -2052,63 +2102,6 @@ public protocol YrsArrayEachDelegate: AnyObject { func call(value: String) } -private extension NSLock { - func withLock(f: () throws -> T) rethrows -> T { - lock() - defer { self.unlock() } - return try f() - } -} - -private typealias UniFFICallbackHandle = UInt64 -private class UniFFICallbackHandleMap { - private var leftMap: [UniFFICallbackHandle: T] = [:] - private var counter: [UniFFICallbackHandle: UInt64] = [:] - private var rightMap: [ObjectIdentifier: UniFFICallbackHandle] = [:] - - private let lock = NSLock() - private var currentHandle: UniFFICallbackHandle = 1 - private let stride: UniFFICallbackHandle = 1 - - func insert(obj: T) -> UniFFICallbackHandle { - lock.withLock { - let id = ObjectIdentifier(obj as AnyObject) - let handle = rightMap[id] ?? { - currentHandle += stride - let handle = currentHandle - leftMap[handle] = obj - rightMap[id] = handle - return handle - }() - counter[handle] = (counter[handle] ?? 0) + 1 - return handle - } - } - - func get(handle: UniFFICallbackHandle) -> T? { - lock.withLock { - leftMap[handle] - } - } - - func delete(handle: UniFFICallbackHandle) { - remove(handle: handle) - } - - @discardableResult - func remove(handle: UniFFICallbackHandle) -> T? { - lock.withLock { - defer { counter[handle] = (counter[handle] ?? 1) - 1 } - guard counter[handle] == 1 else { return leftMap[handle] } - let obj = leftMap.removeValue(forKey: handle) - if let obj = obj { - rightMap.removeValue(forKey: ObjectIdentifier(obj as AnyObject)) - } - return obj - } - } -} - // Magic number for the Rust proxy to call using the same mechanism as every other method, // to free the callback once it's dropped by Rust. private let IDX_CALLBACK_FREE: Int32 = 0 @@ -2117,76 +2110,66 @@ private let UNIFFI_CALLBACK_SUCCESS: Int32 = 0 private let UNIFFI_CALLBACK_ERROR: Int32 = 1 private let UNIFFI_CALLBACK_UNEXPECTED_ERROR: Int32 = 2 -// Declaration and FfiConverters for YrsArrayEachDelegate Callback Interface - -private let uniffiCallbackHandlerYrsArrayEachDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsArrayEachDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsArrayEachDelegate = .init( + call: { ( + uniffiHandle: UInt64, + value: RustBuffer, + _: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsArrayEachDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + value: FfiConverterString.lift(value) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsArrayEachDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - try swiftCallbackInterface.call( - value: FfiConverterString.read(from: &reader) + let writeReturn = { () } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsArrayEachDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsArrayEachDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsArrayEachDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsArrayEachDelegate: handle missing in uniffiFree") + } } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + ) } private func uniffiCallbackInitYrsArrayEachDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrsarrayeachdelegate(uniffiCallbackHandlerYrsArrayEachDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsarrayeachdelegate(&UniffiCallbackInterfaceYrsArrayEachDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsArrayEachDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsArrayEachDelegate: FfiConverter { typealias SwiftType = YrsArrayEachDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -2199,76 +2182,66 @@ public protocol YrsArrayObservationDelegate: AnyObject { func call(value: [YrsChange]) } -// Declaration and FfiConverters for YrsArrayObservationDelegate Callback Interface - -private let uniffiCallbackHandlerYrsArrayObservationDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsArrayObservationDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsArrayObservationDelegate = .init( + call: { ( + uniffiHandle: UInt64, + value: RustBuffer, + _: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsArrayObservationDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + value: FfiConverterSequenceTypeYrsChange.lift(value) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsArrayObservationDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - try swiftCallbackInterface.call( - value: FfiConverterSequenceTypeYrsChange.read(from: &reader) + let writeReturn = { () } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsArrayObservationDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsArrayObservationDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsArrayObservationDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsArrayObservationDelegate: handle missing in uniffiFree") + } } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + ) } private func uniffiCallbackInitYrsArrayObservationDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrsarrayobservationdelegate(uniffiCallbackHandlerYrsArrayObservationDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsarrayobservationdelegate(&UniffiCallbackInterfaceYrsArrayObservationDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsArrayObservationDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsArrayObservationDelegate: FfiConverter { typealias SwiftType = YrsArrayObservationDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -2281,76 +2254,66 @@ public protocol YrsMapIteratorDelegate: AnyObject { func call(value: String) } -// Declaration and FfiConverters for YrsMapIteratorDelegate Callback Interface - -private let uniffiCallbackHandlerYrsMapIteratorDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsMapIteratorDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsMapIteratorDelegate = .init( + call: { ( + uniffiHandle: UInt64, + value: RustBuffer, + _: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsMapIteratorDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + value: FfiConverterString.lift(value) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsMapIteratorDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - try swiftCallbackInterface.call( - value: FfiConverterString.read(from: &reader) + let writeReturn = { () } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsMapIteratorDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsMapIteratorDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsMapIteratorDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsMapIteratorDelegate: handle missing in uniffiFree") + } } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + ) } private func uniffiCallbackInitYrsMapIteratorDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrsmapiteratordelegate(uniffiCallbackHandlerYrsMapIteratorDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsmapiteratordelegate(&UniffiCallbackInterfaceYrsMapIteratorDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsMapIteratorDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsMapIteratorDelegate: FfiConverter { typealias SwiftType = YrsMapIteratorDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -2363,77 +2326,68 @@ public protocol YrsMapKvIteratorDelegate: AnyObject { func call(key: String, value: String) } -// Declaration and FfiConverters for YrsMapKvIteratorDelegate Callback Interface - -private let uniffiCallbackHandlerYrsMapKVIteratorDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsMapKVIteratorDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsMapKvIteratorDelegate = .init( + call: { ( + uniffiHandle: UInt64, + key: RustBuffer, + value: RustBuffer, + _: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + key: FfiConverterString.lift(key), + value: FfiConverterString.lift(value) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsMapKvIteratorDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - try swiftCallbackInterface.call( - key: FfiConverterString.read(from: &reader), - value: FfiConverterString.read(from: &reader) + let writeReturn = { () } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsMapKVIteratorDelegate: handle missing in uniffiFree") + } } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + ) } private func uniffiCallbackInitYrsMapKVIteratorDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrsmapkviteratordelegate(uniffiCallbackHandlerYrsMapKVIteratorDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsmapkviteratordelegate(&UniffiCallbackInterfaceYrsMapKVIteratorDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsMapKvIteratorDelegate: FfiConverter { typealias SwiftType = YrsMapKvIteratorDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -2446,76 +2400,66 @@ public protocol YrsMapObservationDelegate: AnyObject { func call(value: [YrsMapChange]) } -// Declaration and FfiConverters for YrsMapObservationDelegate Callback Interface - -private let uniffiCallbackHandlerYrsMapObservationDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsMapObservationDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsMapObservationDelegate = .init( + call: { ( + uniffiHandle: UInt64, + value: RustBuffer, + _: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsMapObservationDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + value: FfiConverterSequenceTypeYrsMapChange.lift(value) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsMapObservationDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - try swiftCallbackInterface.call( - value: FfiConverterSequenceTypeYrsMapChange.read(from: &reader) + let writeReturn = { () } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsMapObservationDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsMapObservationDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsMapObservationDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsMapObservationDelegate: handle missing in uniffiFree") + } } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + ) } private func uniffiCallbackInitYrsMapObservationDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrsmapobservationdelegate(uniffiCallbackHandlerYrsMapObservationDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsmapobservationdelegate(&UniffiCallbackInterfaceYrsMapObservationDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsMapObservationDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsMapObservationDelegate: FfiConverter { typealias SwiftType = YrsMapObservationDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -2528,76 +2472,66 @@ public protocol YrsTextObservationDelegate: AnyObject { func call(value: [YrsDelta]) } -// Declaration and FfiConverters for YrsTextObservationDelegate Callback Interface - -private let uniffiCallbackHandlerYrsTextObservationDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsTextObservationDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsTextObservationDelegate = .init( + call: { ( + uniffiHandle: UInt64, + value: RustBuffer, + _: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsTextObservationDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + value: FfiConverterSequenceTypeYrsDelta.lift(value) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsTextObservationDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - try swiftCallbackInterface.call( - value: FfiConverterSequenceTypeYrsDelta.read(from: &reader) + let writeReturn = { () } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsTextObservationDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsTextObservationDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsTextObservationDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsTextObservationDelegate: handle missing in uniffiFree") + } } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + ) } private func uniffiCallbackInitYrsTextObservationDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrstextobservationdelegate(uniffiCallbackHandlerYrsTextObservationDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrstextobservationdelegate(&UniffiCallbackInterfaceYrsTextObservationDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsTextObservationDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsTextObservationDelegate: FfiConverter { typealias SwiftType = YrsTextObservationDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -2610,80 +2544,68 @@ public protocol YrsUndoManagerObservationDelegate: AnyObject { func call(e: YrsUndoEvent, ptr: UInt64) -> UInt64 } -// Declaration and FfiConverters for YrsUndoManagerObservationDelegate Callback Interface - -private let uniffiCallbackHandlerYrsUndoManagerObservationDelegate: ForeignCallback = { (handle: UniFFICallbackHandle, method: Int32, argsData: UnsafePointer, argsLen: Int32, out_buf: UnsafeMutablePointer) -> Int32 in +// Put the implementation in a struct so we don't pollute the top-level namespace +private enum UniffiCallbackInterfaceYrsUndoManagerObservationDelegate { + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + static var vtable: UniffiVTableCallbackInterfaceYrsUndoManagerObservationDelegate = .init( + call: { ( + uniffiHandle: UInt64, + e: UnsafeMutableRawPointer, + ptr: UInt64, + uniffiOutReturn: UnsafeMutablePointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> UInt64 in + guard let uniffiObj = try? FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.call( + e: FfiConverterTypeYrsUndoEvent.lift(e), + ptr: FfiConverterUInt64.lift(ptr) + ) + } - func invokeCall(_ swiftCallbackInterface: YrsUndoManagerObservationDelegate, _ argsData: UnsafePointer, _ argsLen: Int32, _ out_buf: UnsafeMutablePointer) throws -> Int32 { - var reader = createReader(data: Data(bytes: argsData, count: Int(argsLen))) - func makeCall() throws -> Int32 { - let result = try swiftCallbackInterface.call( - e: FfiConverterTypeYrsUndoEvent.read(from: &reader), - ptr: FfiConverterUInt64.read(from: &reader) + let writeReturn = { uniffiOutReturn.pointee = FfiConverterUInt64.lower($0) } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn ) - var writer = [UInt8]() - FfiConverterUInt64.write(result, into: &writer) - out_buf.pointee = RustBuffer(bytes: writer) - return UNIFFI_CALLBACK_SUCCESS - } - return try makeCall() - } - - switch method { - case IDX_CALLBACK_FREE: - FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.handleMap.remove(handle: handle) - // Successful return - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_SUCCESS - case 1: - guard let cb = FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.handleMap.get(handle: handle) else { - out_buf.pointee = FfiConverterString.lower("No callback in handlemap; this is a Uniffi bug") - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - do { - return try invokeCall(cb, argsData, argsLen, out_buf) - } catch { - out_buf.pointee = FfiConverterString.lower(String(describing: error)) - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } - - // This should never happen, because an out of bounds method index won't - // ever be used. Once we can catch errors, we should return an InternalError. - // https://github.com/mozilla/uniffi-rs/issues/351 - default: - // An unexpected error happened. - // See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` - return UNIFFI_CALLBACK_UNEXPECTED_ERROR - } + }, + uniffiFree: { (uniffiHandle: UInt64) in + let result = try? FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate.handleMap.remove(handle: uniffiHandle) + if result == nil { + print("Uniffi callback interface YrsUndoManagerObservationDelegate: handle missing in uniffiFree") + } + } + ) } private func uniffiCallbackInitYrsUndoManagerObservationDelegate() { - uniffi_uniffi_yniffi_fn_init_callback_yrsundomanagerobservationdelegate(uniffiCallbackHandlerYrsUndoManagerObservationDelegate) + uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsundomanagerobservationdelegate(&UniffiCallbackInterfaceYrsUndoManagerObservationDelegate.vtable) } // FfiConverter protocol for callback interfaces private enum FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate { - fileprivate static var handleMap = UniFFICallbackHandleMap() + fileprivate static var handleMap = UniffiHandleMap() } extension FfiConverterCallbackInterfaceYrsUndoManagerObservationDelegate: FfiConverter { typealias SwiftType = YrsUndoManagerObservationDelegate - // We can use Handle as the FfiType because it's a typealias to UInt64 - typealias FfiType = UniFFICallbackHandle + typealias FfiType = UInt64 - public static func lift(_ handle: UniFFICallbackHandle) throws -> SwiftType { - guard let callback = handleMap.get(handle: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return callback + public static func lift(_ handle: UInt64) throws -> SwiftType { + try handleMap.get(handle: handle) } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - let handle: UniFFICallbackHandle = try readInt(&buf) + let handle: UInt64 = try readInt(&buf) return try lift(handle) } - public static func lower(_ v: SwiftType) -> UniFFICallbackHandle { + public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } @@ -3001,7 +2923,7 @@ private enum InitializationResult { // the code inside is only computed once. private var initializationResult: InitializationResult { // Get the bindings contract version from our ComponentInterface - let bindings_contract_version = 25 + let bindings_contract_version = 26 // Get the scaffolding contract version by calling the into the dylib let scaffolding_contract_version = ffi_uniffi_yniffi_uniffi_contract_version() if bindings_contract_version != scaffolding_contract_version { @@ -3196,7 +3118,7 @@ private var initializationResult: InitializationResult { if uniffi_uniffi_yniffi_checksum_method_yrsundomanager_wrap_changes() != 6579 { return InitializationResult.apiChecksumMismatch } - if uniffi_uniffi_yniffi_checksum_constructor_yrsdoc_new() != 35383 { + if uniffi_uniffi_yniffi_checksum_constructor_yrsdoc_new() != 51551 { return InitializationResult.apiChecksumMismatch } if uniffi_uniffi_yniffi_checksum_method_yrsarrayeachdelegate_call() != 23816 { @@ -3241,3 +3163,5 @@ private func uniffiEnsureInitialized() { fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } } + +// swiftlint:enable all diff --git a/lib/swift/scaffold/yniffiFFI.h b/lib/swift/scaffold/yniffiFFI.h index 63f047e..ab04162 100644 --- a/lib/swift/scaffold/yniffiFFI.h +++ b/lib/swift/scaffold/yniffiFFI.h @@ -24,13 +24,11 @@ typedef struct RustBuffer { - int32_t capacity; - int32_t len; + uint64_t capacity; + uint64_t len; uint8_t *_Nullable data; } RustBuffer; -typedef int32_t (*ForeignCallback)(uint64_t, int32_t, const uint8_t *_Nonnull, int32_t, RustBuffer *_Nonnull); - typedef struct ForeignBytes { int32_t len; @@ -46,512 +44,1464 @@ typedef struct RustCallStatus { // ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ // ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ #endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +typedef void (*UniffiForeignFutureFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE +typedef struct UniffiForeignFuture { + uint64_t handle; + UniffiForeignFutureFree _Nonnull free; +} UniffiForeignFuture; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +typedef struct UniffiForeignFutureStructU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureStructU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +typedef struct UniffiForeignFutureStructI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureStructI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +typedef struct UniffiForeignFutureStructU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureStructU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +typedef struct UniffiForeignFutureStructI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureStructI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +typedef struct UniffiForeignFutureStructU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureStructU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +typedef struct UniffiForeignFutureStructI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureStructI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +typedef struct UniffiForeignFutureStructU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureStructU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +typedef struct UniffiForeignFutureStructI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureStructI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +typedef struct UniffiForeignFutureStructF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureStructF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +typedef struct UniffiForeignFutureStructF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureStructF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +typedef struct UniffiForeignFutureStructPointer { + void*_Nonnull returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructPointer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +typedef void (*UniffiForeignFutureCompletePointer)(uint64_t, UniffiForeignFutureStructPointer + ); -// Continuation callback for UniFFI Futures -typedef void (*UniFfiRustFutureContinuation)(void * _Nonnull, int8_t); +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +typedef struct UniffiForeignFutureStructRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructRustBuffer; -// Scaffolding functions +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureStructRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +typedef struct UniffiForeignFutureStructVoid { + RustCallStatus callStatus; +} UniffiForeignFutureStructVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_ARRAY_EACH_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_ARRAY_EACH_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsArrayEachDelegateMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_ARRAY_OBSERVATION_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_ARRAY_OBSERVATION_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsArrayObservationDelegateMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_MAP_ITERATOR_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_MAP_ITERATOR_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsMapIteratorDelegateMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_MAP_KV_ITERATOR_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_MAP_KV_ITERATOR_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsMapKvIteratorDelegateMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_MAP_OBSERVATION_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_MAP_OBSERVATION_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsMapObservationDelegateMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_TEXT_OBSERVATION_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_TEXT_OBSERVATION_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsTextObservationDelegateMethod0)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_UNDO_MANAGER_OBSERVATION_DELEGATE_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_YRS_UNDO_MANAGER_OBSERVATION_DELEGATE_METHOD0 +typedef void (*UniffiCallbackInterfaceYrsUndoManagerObservationDelegateMethod0)(uint64_t, void*_Nonnull, uint64_t, uint64_t* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_ARRAY_EACH_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_ARRAY_EACH_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsArrayEachDelegate { + UniffiCallbackInterfaceYrsArrayEachDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsArrayEachDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_ARRAY_OBSERVATION_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_ARRAY_OBSERVATION_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsArrayObservationDelegate { + UniffiCallbackInterfaceYrsArrayObservationDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsArrayObservationDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_MAP_ITERATOR_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_MAP_ITERATOR_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsMapIteratorDelegate { + UniffiCallbackInterfaceYrsMapIteratorDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsMapIteratorDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_MAP_KV_ITERATOR_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_MAP_KV_ITERATOR_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsMapKvIteratorDelegate { + UniffiCallbackInterfaceYrsMapKvIteratorDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsMapKvIteratorDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_MAP_OBSERVATION_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_MAP_OBSERVATION_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsMapObservationDelegate { + UniffiCallbackInterfaceYrsMapObservationDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsMapObservationDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_TEXT_OBSERVATION_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_TEXT_OBSERVATION_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsTextObservationDelegate { + UniffiCallbackInterfaceYrsTextObservationDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsTextObservationDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_UNDO_MANAGER_OBSERVATION_DELEGATE +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_YRS_UNDO_MANAGER_OBSERVATION_DELEGATE +typedef struct UniffiVTableCallbackInterfaceYrsUndoManagerObservationDelegate { + UniffiCallbackInterfaceYrsUndoManagerObservationDelegateMethod0 _Nonnull call; + UniffiCallbackInterfaceFree _Nonnull uniffiFree; +} UniffiVTableCallbackInterfaceYrsUndoManagerObservationDelegate; + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YSUBSCRIPTION +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YSUBSCRIPTION void*_Nonnull uniffi_uniffi_yniffi_fn_clone_ysubscription(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YSUBSCRIPTION +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YSUBSCRIPTION void uniffi_uniffi_yniffi_fn_free_ysubscription(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSARRAY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSARRAY void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrsarray(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSARRAY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSARRAY void uniffi_uniffi_yniffi_fn_free_yrsarray(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_EACH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_EACH void uniffi_uniffi_yniffi_fn_method_yrsarray_each(void*_Nonnull ptr, void*_Nonnull tx, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_GET +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_GET RustBuffer uniffi_uniffi_yniffi_fn_method_yrsarray_get(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_INSERT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_INSERT void uniffi_uniffi_yniffi_fn_method_yrsarray_insert(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustBuffer value, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_INSERT_RANGE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_INSERT_RANGE void uniffi_uniffi_yniffi_fn_method_yrsarray_insert_range(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustBuffer values, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_LENGTH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_LENGTH uint32_t uniffi_uniffi_yniffi_fn_method_yrsarray_length(void*_Nonnull ptr, void*_Nonnull tx, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_OBSERVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_OBSERVE void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsarray_observe(void*_Nonnull ptr, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_PUSH_BACK +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_PUSH_BACK void uniffi_uniffi_yniffi_fn_method_yrsarray_push_back(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer value, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_PUSH_FRONT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_PUSH_FRONT void uniffi_uniffi_yniffi_fn_method_yrsarray_push_front(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer value, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_RAW_PTR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_RAW_PTR uint64_t uniffi_uniffi_yniffi_fn_method_yrsarray_raw_ptr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_REMOVE void uniffi_uniffi_yniffi_fn_method_yrsarray_remove(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_REMOVE_RANGE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_REMOVE_RANGE void uniffi_uniffi_yniffi_fn_method_yrsarray_remove_range(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, uint32_t len, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_TO_A +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSARRAY_TO_A RustBuffer uniffi_uniffi_yniffi_fn_method_yrsarray_to_a(void*_Nonnull ptr, void*_Nonnull tx, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSDOC +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSDOC void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrsdoc(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSDOC +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSDOC void uniffi_uniffi_yniffi_fn_free_yrsdoc(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CONSTRUCTOR_YRSDOC_NEW +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CONSTRUCTOR_YRSDOC_NEW void*_Nonnull uniffi_uniffi_yniffi_fn_constructor_yrsdoc_new(RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_ENCODE_DIFF_V1 +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_ENCODE_DIFF_V1 RustBuffer uniffi_uniffi_yniffi_fn_method_yrsdoc_encode_diff_v1(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer state_vector, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_GET_ARRAY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_GET_ARRAY void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsdoc_get_array(void*_Nonnull ptr, RustBuffer name, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_GET_MAP +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_GET_MAP void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsdoc_get_map(void*_Nonnull ptr, RustBuffer name, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_GET_TEXT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_GET_TEXT void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsdoc_get_text(void*_Nonnull ptr, RustBuffer name, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_TRANSACT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_TRANSACT void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsdoc_transact(void*_Nonnull ptr, RustBuffer origin, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_UNDO_MANAGER +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSDOC_UNDO_MANAGER void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsdoc_undo_manager(void*_Nonnull ptr, RustBuffer tracked_refs, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSMAP +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSMAP void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrsmap(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSMAP +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSMAP void uniffi_uniffi_yniffi_fn_free_yrsmap(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_CLEAR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_CLEAR void uniffi_uniffi_yniffi_fn_method_yrsmap_clear(void*_Nonnull ptr, void*_Nonnull tx, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_CONTAINS_KEY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_CONTAINS_KEY int8_t uniffi_uniffi_yniffi_fn_method_yrsmap_contains_key(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer key, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_EACH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_EACH void uniffi_uniffi_yniffi_fn_method_yrsmap_each(void*_Nonnull ptr, void*_Nonnull tx, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_GET +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_GET RustBuffer uniffi_uniffi_yniffi_fn_method_yrsmap_get(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer key, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_INSERT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_INSERT void uniffi_uniffi_yniffi_fn_method_yrsmap_insert(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer key, RustBuffer value, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_KEYS +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_KEYS void uniffi_uniffi_yniffi_fn_method_yrsmap_keys(void*_Nonnull ptr, void*_Nonnull tx, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_LENGTH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_LENGTH uint32_t uniffi_uniffi_yniffi_fn_method_yrsmap_length(void*_Nonnull ptr, void*_Nonnull tx, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_OBSERVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_OBSERVE void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsmap_observe(void*_Nonnull ptr, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_RAW_PTR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_RAW_PTR uint64_t uniffi_uniffi_yniffi_fn_method_yrsmap_raw_ptr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_REMOVE RustBuffer uniffi_uniffi_yniffi_fn_method_yrsmap_remove(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer key, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_VALUES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSMAP_VALUES void uniffi_uniffi_yniffi_fn_method_yrsmap_values(void*_Nonnull ptr, void*_Nonnull tx, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSTEXT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSTEXT void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrstext(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSTEXT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSTEXT void uniffi_uniffi_yniffi_fn_free_yrstext(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_APPEND +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_APPEND void uniffi_uniffi_yniffi_fn_method_yrstext_append(void*_Nonnull ptr, void*_Nonnull tx, RustBuffer text, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_FORMAT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_FORMAT void uniffi_uniffi_yniffi_fn_method_yrstext_format(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, uint32_t length, RustBuffer attrs, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_GET_STRING +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_GET_STRING RustBuffer uniffi_uniffi_yniffi_fn_method_yrstext_get_string(void*_Nonnull ptr, void*_Nonnull tx, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT void uniffi_uniffi_yniffi_fn_method_yrstext_insert(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustBuffer chunk, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT_EMBED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT_EMBED void uniffi_uniffi_yniffi_fn_method_yrstext_insert_embed(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustBuffer content, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT_EMBED_WITH_ATTRIBUTES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT_EMBED_WITH_ATTRIBUTES void uniffi_uniffi_yniffi_fn_method_yrstext_insert_embed_with_attributes(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustBuffer content, RustBuffer attrs, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT_WITH_ATTRIBUTES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_INSERT_WITH_ATTRIBUTES void uniffi_uniffi_yniffi_fn_method_yrstext_insert_with_attributes(void*_Nonnull ptr, void*_Nonnull tx, uint32_t index, RustBuffer chunk, RustBuffer attrs, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_LENGTH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_LENGTH uint32_t uniffi_uniffi_yniffi_fn_method_yrstext_length(void*_Nonnull ptr, void*_Nonnull tx, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_OBSERVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_OBSERVE void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrstext_observe(void*_Nonnull ptr, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_RAW_PTR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_RAW_PTR uint64_t uniffi_uniffi_yniffi_fn_method_yrstext_raw_ptr(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_REMOVE_RANGE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTEXT_REMOVE_RANGE void uniffi_uniffi_yniffi_fn_method_yrstext_remove_range(void*_Nonnull ptr, void*_Nonnull tx, uint32_t start, uint32_t length, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSTRANSACTION +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSTRANSACTION void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrstransaction(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSTRANSACTION +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSTRANSACTION void uniffi_uniffi_yniffi_fn_free_yrstransaction(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_FREE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_FREE void uniffi_uniffi_yniffi_fn_method_yrstransaction_free(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_ORIGIN RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_origin(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_APPLY_UPDATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_APPLY_UPDATE void uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_apply_update(void*_Nonnull ptr, RustBuffer update, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_state_as_update(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE_FROM_SV +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE_FROM_SV RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_state_as_update_from_sv(void*_Nonnull ptr, RustBuffer state_vector, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_UPDATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_UPDATE RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_encode_update(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_GET_ARRAY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_GET_ARRAY RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_array(void*_Nonnull ptr, RustBuffer name, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_GET_MAP +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_GET_MAP RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_map(void*_Nonnull ptr, RustBuffer name, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_GET_TEXT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_GET_TEXT RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_get_text(void*_Nonnull ptr, RustBuffer name, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_STATE_VECTOR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSTRANSACTION_TRANSACTION_STATE_VECTOR RustBuffer uniffi_uniffi_yniffi_fn_method_yrstransaction_transaction_state_vector(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSUNDOEVENT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSUNDOEVENT void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrsundoevent(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSUNDOEVENT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSUNDOEVENT void uniffi_uniffi_yniffi_fn_free_yrsundoevent(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOEVENT_HAS_CHANGED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOEVENT_HAS_CHANGED int8_t uniffi_uniffi_yniffi_fn_method_yrsundoevent_has_changed(void*_Nonnull ptr, uint64_t shared_ref, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOEVENT_KIND +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOEVENT_KIND RustBuffer uniffi_uniffi_yniffi_fn_method_yrsundoevent_kind(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOEVENT_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOEVENT_ORIGIN RustBuffer uniffi_uniffi_yniffi_fn_method_yrsundoevent_origin(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSUNDOMANAGER +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_CLONE_YRSUNDOMANAGER void*_Nonnull uniffi_uniffi_yniffi_fn_clone_yrsundomanager(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSUNDOMANAGER +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_FREE_YRSUNDOMANAGER void uniffi_uniffi_yniffi_fn_free_yrsundomanager(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_ADD_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_ADD_ORIGIN void uniffi_uniffi_yniffi_fn_method_yrsundomanager_add_origin(void*_Nonnull ptr, RustBuffer origin, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_ADD_SCOPE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_ADD_SCOPE void uniffi_uniffi_yniffi_fn_method_yrsundomanager_add_scope(void*_Nonnull ptr, uint64_t tracked_ref, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_CLEAR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_CLEAR void uniffi_uniffi_yniffi_fn_method_yrsundomanager_clear(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_OBSERVE_ADDED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_OBSERVE_ADDED void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_added(void*_Nonnull ptr, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_OBSERVE_POPPED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_OBSERVE_POPPED void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_popped(void*_Nonnull ptr, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_OBSERVE_UPDATED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_OBSERVE_UPDATED void*_Nonnull uniffi_uniffi_yniffi_fn_method_yrsundomanager_observe_updated(void*_Nonnull ptr, uint64_t delegate, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_REDO +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_REDO int8_t uniffi_uniffi_yniffi_fn_method_yrsundomanager_redo(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_REMOVE_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_REMOVE_ORIGIN void uniffi_uniffi_yniffi_fn_method_yrsundomanager_remove_origin(void*_Nonnull ptr, RustBuffer origin, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_UNDO +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_UNDO int8_t uniffi_uniffi_yniffi_fn_method_yrsundomanager_undo(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_WRAP_CHANGES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_METHOD_YRSUNDOMANAGER_WRAP_CHANGES void uniffi_uniffi_yniffi_fn_method_yrsundomanager_wrap_changes(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status ); -void uniffi_uniffi_yniffi_fn_init_callback_yrsarrayeachdelegate(ForeignCallback _Nonnull handle -); -void uniffi_uniffi_yniffi_fn_init_callback_yrsarrayobservationdelegate(ForeignCallback _Nonnull handle -); -void uniffi_uniffi_yniffi_fn_init_callback_yrsmapiteratordelegate(ForeignCallback _Nonnull handle -); -void uniffi_uniffi_yniffi_fn_init_callback_yrsmapkviteratordelegate(ForeignCallback _Nonnull handle -); -void uniffi_uniffi_yniffi_fn_init_callback_yrsmapobservationdelegate(ForeignCallback _Nonnull handle -); -void uniffi_uniffi_yniffi_fn_init_callback_yrstextobservationdelegate(ForeignCallback _Nonnull handle -); -void uniffi_uniffi_yniffi_fn_init_callback_yrsundomanagerobservationdelegate(ForeignCallback _Nonnull handle -); -RustBuffer ffi_uniffi_yniffi_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status -); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSARRAYEACHDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSARRAYEACHDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsarrayeachdelegate(UniffiVTableCallbackInterfaceYrsArrayEachDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSARRAYOBSERVATIONDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSARRAYOBSERVATIONDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsarrayobservationdelegate(UniffiVTableCallbackInterfaceYrsArrayObservationDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSMAPITERATORDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSMAPITERATORDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsmapiteratordelegate(UniffiVTableCallbackInterfaceYrsMapIteratorDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSMAPKVITERATORDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSMAPKVITERATORDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsmapkviteratordelegate(UniffiVTableCallbackInterfaceYrsMapKvIteratorDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSMAPOBSERVATIONDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSMAPOBSERVATIONDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsmapobservationdelegate(UniffiVTableCallbackInterfaceYrsMapObservationDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSTEXTOBSERVATIONDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSTEXTOBSERVATIONDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrstextobservationdelegate(UniffiVTableCallbackInterfaceYrsTextObservationDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSUNDOMANAGEROBSERVATIONDELEGATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_FN_INIT_CALLBACK_VTABLE_YRSUNDOMANAGEROBSERVATIONDELEGATE +void uniffi_uniffi_yniffi_fn_init_callback_vtable_yrsundomanagerobservationdelegate(UniffiVTableCallbackInterfaceYrsUndoManagerObservationDelegate* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_ALLOC +RustBuffer ffi_uniffi_yniffi_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_FROM_BYTES RustBuffer ffi_uniffi_yniffi_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status ); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_FREE void ffi_uniffi_yniffi_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status ); -RustBuffer ffi_uniffi_yniffi_rustbuffer_reserve(RustBuffer buf, int32_t additional, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_u8(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_u8(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_u8(void* _Nonnull handle -); -uint8_t ffi_uniffi_yniffi_rust_future_complete_u8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_i8(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_i8(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_i8(void* _Nonnull handle -); -int8_t ffi_uniffi_yniffi_rust_future_complete_i8(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_u16(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_u16(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_u16(void* _Nonnull handle -); -uint16_t ffi_uniffi_yniffi_rust_future_complete_u16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_i16(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_i16(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_i16(void* _Nonnull handle -); -int16_t ffi_uniffi_yniffi_rust_future_complete_i16(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_u32(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_u32(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_u32(void* _Nonnull handle -); -uint32_t ffi_uniffi_yniffi_rust_future_complete_u32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_i32(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_i32(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_i32(void* _Nonnull handle -); -int32_t ffi_uniffi_yniffi_rust_future_complete_i32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_u64(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_u64(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_u64(void* _Nonnull handle -); -uint64_t ffi_uniffi_yniffi_rust_future_complete_u64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_i64(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_i64(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_i64(void* _Nonnull handle -); -int64_t ffi_uniffi_yniffi_rust_future_complete_i64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_f32(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_f32(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_f32(void* _Nonnull handle -); -float ffi_uniffi_yniffi_rust_future_complete_f32(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_f64(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_f64(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_f64(void* _Nonnull handle -); -double ffi_uniffi_yniffi_rust_future_complete_f64(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_pointer(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_pointer(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_pointer(void* _Nonnull handle -); -void*_Nonnull ffi_uniffi_yniffi_rust_future_complete_pointer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_rust_buffer(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_rust_buffer(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_rust_buffer(void* _Nonnull handle -); -RustBuffer ffi_uniffi_yniffi_rust_future_complete_rust_buffer(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); -void ffi_uniffi_yniffi_rust_future_poll_void(void* _Nonnull handle, UniFfiRustFutureContinuation _Nonnull callback, void* _Nonnull callback_data -); -void ffi_uniffi_yniffi_rust_future_cancel_void(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_free_void(void* _Nonnull handle -); -void ffi_uniffi_yniffi_rust_future_complete_void(void* _Nonnull handle, RustCallStatus *_Nonnull out_status -); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUSTBUFFER_RESERVE +RustBuffer ffi_uniffi_yniffi_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U8 +void ffi_uniffi_yniffi_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U8 +void ffi_uniffi_yniffi_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U8 +void ffi_uniffi_yniffi_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_uniffi_yniffi_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I8 +void ffi_uniffi_yniffi_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I8 +void ffi_uniffi_yniffi_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I8 +void ffi_uniffi_yniffi_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_uniffi_yniffi_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U16 +void ffi_uniffi_yniffi_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U16 +void ffi_uniffi_yniffi_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U16 +void ffi_uniffi_yniffi_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_uniffi_yniffi_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I16 +void ffi_uniffi_yniffi_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I16 +void ffi_uniffi_yniffi_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I16 +void ffi_uniffi_yniffi_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_uniffi_yniffi_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U32 +void ffi_uniffi_yniffi_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U32 +void ffi_uniffi_yniffi_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U32 +void ffi_uniffi_yniffi_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_uniffi_yniffi_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I32 +void ffi_uniffi_yniffi_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I32 +void ffi_uniffi_yniffi_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I32 +void ffi_uniffi_yniffi_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_uniffi_yniffi_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_U64 +void ffi_uniffi_yniffi_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_U64 +void ffi_uniffi_yniffi_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_U64 +void ffi_uniffi_yniffi_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_uniffi_yniffi_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_I64 +void ffi_uniffi_yniffi_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_I64 +void ffi_uniffi_yniffi_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_I64 +void ffi_uniffi_yniffi_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_uniffi_yniffi_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_F32 +void ffi_uniffi_yniffi_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_F32 +void ffi_uniffi_yniffi_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_F32 +void ffi_uniffi_yniffi_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_F32 +float ffi_uniffi_yniffi_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_F64 +void ffi_uniffi_yniffi_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_F64 +void ffi_uniffi_yniffi_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_F64 +void ffi_uniffi_yniffi_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_F64 +double ffi_uniffi_yniffi_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_POINTER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_POINTER +void ffi_uniffi_yniffi_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_POINTER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_POINTER +void ffi_uniffi_yniffi_rust_future_cancel_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_POINTER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_POINTER +void ffi_uniffi_yniffi_rust_future_free_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_POINTER +void*_Nonnull ffi_uniffi_yniffi_rust_future_complete_pointer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_uniffi_yniffi_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_uniffi_yniffi_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_uniffi_yniffi_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_uniffi_yniffi_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_POLL_VOID +void ffi_uniffi_yniffi_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_CANCEL_VOID +void ffi_uniffi_yniffi_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_FREE_VOID +void ffi_uniffi_yniffi_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_RUST_FUTURE_COMPLETE_VOID +void ffi_uniffi_yniffi_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_EACH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_EACH uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_each(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_GET +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_GET uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_get(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_INSERT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_INSERT uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_insert(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_INSERT_RANGE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_INSERT_RANGE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_insert_range(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_LENGTH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_LENGTH uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_length(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_OBSERVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_OBSERVE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_observe(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_PUSH_BACK +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_PUSH_BACK uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_push_back(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_PUSH_FRONT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_PUSH_FRONT uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_push_front(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_RAW_PTR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_RAW_PTR uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_raw_ptr(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_REMOVE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_remove(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_REMOVE_RANGE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_REMOVE_RANGE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_remove_range(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_TO_A +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAY_TO_A uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarray_to_a(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_ENCODE_DIFF_V1 +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_ENCODE_DIFF_V1 uint16_t uniffi_uniffi_yniffi_checksum_method_yrsdoc_encode_diff_v1(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_GET_ARRAY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_GET_ARRAY uint16_t uniffi_uniffi_yniffi_checksum_method_yrsdoc_get_array(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_GET_MAP +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_GET_MAP uint16_t uniffi_uniffi_yniffi_checksum_method_yrsdoc_get_map(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_GET_TEXT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_GET_TEXT uint16_t uniffi_uniffi_yniffi_checksum_method_yrsdoc_get_text(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_TRANSACT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_TRANSACT uint16_t uniffi_uniffi_yniffi_checksum_method_yrsdoc_transact(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_UNDO_MANAGER +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSDOC_UNDO_MANAGER uint16_t uniffi_uniffi_yniffi_checksum_method_yrsdoc_undo_manager(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_CLEAR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_CLEAR uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_clear(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_CONTAINS_KEY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_CONTAINS_KEY uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_contains_key(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_EACH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_EACH uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_each(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_GET +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_GET uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_get(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_INSERT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_INSERT uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_insert(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_KEYS +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_KEYS uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_keys(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_LENGTH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_LENGTH uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_length(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_OBSERVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_OBSERVE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_observe(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_RAW_PTR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_RAW_PTR uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_raw_ptr(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_REMOVE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_remove(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_VALUES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAP_VALUES uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmap_values(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_APPEND +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_APPEND uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_append(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_FORMAT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_FORMAT uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_format(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_GET_STRING +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_GET_STRING uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_get_string(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_insert(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT_EMBED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT_EMBED uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_insert_embed(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT_EMBED_WITH_ATTRIBUTES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT_EMBED_WITH_ATTRIBUTES uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_insert_embed_with_attributes(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT_WITH_ATTRIBUTES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_INSERT_WITH_ATTRIBUTES uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_insert_with_attributes(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_LENGTH +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_LENGTH uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_length(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_OBSERVE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_OBSERVE uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_observe(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_RAW_PTR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_RAW_PTR uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_raw_ptr(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_REMOVE_RANGE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXT_REMOVE_RANGE uint16_t uniffi_uniffi_yniffi_checksum_method_yrstext_remove_range(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_FREE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_FREE uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_free(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_ORIGIN uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_origin(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_APPLY_UPDATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_APPLY_UPDATE uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_apply_update(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_encode_state_as_update(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE_FROM_SV +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_STATE_AS_UPDATE_FROM_SV uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_encode_state_as_update_from_sv(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_UPDATE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_ENCODE_UPDATE uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_encode_update(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_GET_ARRAY +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_GET_ARRAY uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_get_array(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_GET_MAP +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_GET_MAP uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_get_map(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_GET_TEXT +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_GET_TEXT uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_get_text(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_STATE_VECTOR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTRANSACTION_TRANSACTION_STATE_VECTOR uint16_t uniffi_uniffi_yniffi_checksum_method_yrstransaction_transaction_state_vector(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOEVENT_HAS_CHANGED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOEVENT_HAS_CHANGED uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundoevent_has_changed(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOEVENT_KIND +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOEVENT_KIND uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundoevent_kind(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOEVENT_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOEVENT_ORIGIN uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundoevent_origin(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_ADD_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_ADD_ORIGIN uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_add_origin(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_ADD_SCOPE +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_ADD_SCOPE uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_add_scope(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_CLEAR +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_CLEAR uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_clear(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_OBSERVE_ADDED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_OBSERVE_ADDED uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_observe_added(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_OBSERVE_POPPED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_OBSERVE_POPPED uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_observe_popped(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_OBSERVE_UPDATED +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_OBSERVE_UPDATED uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_observe_updated(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_REDO +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_REDO uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_redo(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_REMOVE_ORIGIN +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_REMOVE_ORIGIN uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_remove_origin(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_UNDO +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_UNDO uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_undo(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_WRAP_CHANGES +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGER_WRAP_CHANGES uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanager_wrap_changes(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_CONSTRUCTOR_YRSDOC_NEW +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_CONSTRUCTOR_YRSDOC_NEW uint16_t uniffi_uniffi_yniffi_checksum_constructor_yrsdoc_new(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAYEACHDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAYEACHDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarrayeachdelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAYOBSERVATIONDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSARRAYOBSERVATIONDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrsarrayobservationdelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAPITERATORDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAPITERATORDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmapiteratordelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAPKVITERATORDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAPKVITERATORDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmapkviteratordelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAPOBSERVATIONDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSMAPOBSERVATIONDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrsmapobservationdelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXTOBSERVATIONDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSTEXTOBSERVATIONDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrstextobservationdelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGEROBSERVATIONDELEGATE_CALL +#define UNIFFI_FFIDEF_UNIFFI_UNIFFI_YNIFFI_CHECKSUM_METHOD_YRSUNDOMANAGEROBSERVATIONDELEGATE_CALL uint16_t uniffi_uniffi_yniffi_checksum_method_yrsundomanagerobservationdelegate_call(void ); +#endif +#ifndef UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_UNIFFI_YNIFFI_UNIFFI_CONTRACT_VERSION uint32_t ffi_uniffi_yniffi_uniffi_contract_version(void ); +#endif