diff --git a/.gitignore b/.gitignore index 16a21e8..3e8a298 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ DerivedData/ .netrc /gen-swift loroFFI.xcframework -loroFFI.xcframework.zip \ No newline at end of file +loroFFI.xcframework.zip +target/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ff36dfc..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "loro-ffi"] - path = loro-ffi - url = https://github.com/loro-dev/loro-ffi.git diff --git a/Sources/Loro/Event.swift b/Sources/Loro/Event.swift index 284427f..fb91b78 100644 --- a/Sources/Loro/Event.swift +++ b/Sources/Loro/Event.swift @@ -46,7 +46,7 @@ extension LoroDoc{ * - `doc.import(data)` is called. * - `doc.checkout(version)` is called. */ - public func subscribe(containerId: ContainerId, callback: @escaping (DiffEvent)->Void) -> Subscription { + public func subscribe(containerId: ContainerId, callback: @escaping (DiffEvent)->Void) -> Subscription { let closureSubscriber = ClosureSubscriber(closure: callback) return self.subscribe(containerId: containerId, subscriber: closureSubscriber) } @@ -59,3 +59,111 @@ extension LoroDoc{ return self.subscribeLocalUpdate(callback: closureLocalUpdate) } } + +extension LoroText{ + /** Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription id that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * - `doc.commit()` is called. + * - `doc.exportFrom(version)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + public func subscribe(callback: @escaping (DiffEvent)->Void) -> Subscription? { + let closureSubscriber = ClosureSubscriber(closure: callback) + return self.subscribe(subscriber: closureSubscriber) + } +} + +extension LoroList{ + /** Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription id that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * - `doc.commit()` is called. + * - `doc.exportFrom(version)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + public func subscribe(callback: @escaping (DiffEvent)->Void) -> Subscription? { + let closureSubscriber = ClosureSubscriber(closure: callback) + return self.subscribe(subscriber: closureSubscriber) + } +} + +extension LoroMap{ + /** Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription id that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * - `doc.commit()` is called. + * - `doc.exportFrom(version)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + public func subscribe(callback: @escaping (DiffEvent)->Void) -> Subscription? { + let closureSubscriber = ClosureSubscriber(closure: callback) + return self.subscribe(subscriber: closureSubscriber) + } +} + +extension LoroTree{ + /** Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription id that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * - `doc.commit()` is called. + * - `doc.exportFrom(version)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + public func subscribe(callback: @escaping (DiffEvent)->Void) -> Subscription? { + let closureSubscriber = ClosureSubscriber(closure: callback) + return self.subscribe(subscriber: closureSubscriber) + } +} + +extension LoroMovableList{ + /** Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription id that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * - `doc.commit()` is called. + * - `doc.exportFrom(version)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + public func subscribe(callback: @escaping (DiffEvent)->Void) -> Subscription? { + let closureSubscriber = ClosureSubscriber(closure: callback) + return self.subscribe(subscriber: closureSubscriber) + } +} + +extension LoroCounter{ + /** Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription id that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * - `doc.commit()` is called. + * - `doc.exportFrom(version)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + public func subscribe(callback: @escaping (DiffEvent)->Void) -> Subscription? { + let closureSubscriber = ClosureSubscriber(closure: callback) + return self.subscribe(subscriber: closureSubscriber) + } +} \ No newline at end of file diff --git a/Sources/Loro/LoroFFI.swift b/Sources/Loro/LoroFFI.swift index 0537fcd..00c7fb4 100644 --- a/Sources/Loro/LoroFFI.swift +++ b/Sources/Loro/LoroFFI.swift @@ -1418,6 +1418,8 @@ public func FfiConverterTypeContainerIdLike_lower(_ value: ContainerIdLike) -> U public protocol CursorProtocol : AnyObject { + func encode() -> Data + } open class Cursor: @@ -1479,8 +1481,23 @@ public convenience init(id: Id?, container: ContainerId, side: Side, originPos: } +public static func decode(data: Data)throws -> Cursor { + return try FfiConverterTypeCursor.lift(try rustCallWithError(FfiConverterTypeLoroError.lift) { + uniffi_loro_ffi_fn_constructor_cursor_decode( + FfiConverterData.lower(data),$0 + ) +}) +} + +open func encode() -> Data { + return try! FfiConverterData.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_cursor_encode(self.uniffiClonePointer(),$0 + ) +}) +} + } @@ -2940,6 +2957,21 @@ public protocol LoroCounterProtocol : AnyObject { */ func isDeleted() -> Bool + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + func subscribe(subscriber: Subscriber) -> Subscription? + } open class LoroCounter: @@ -3085,6 +3117,27 @@ open func isDeleted() -> Bool { }) } + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ +open func subscribe(subscriber: Subscriber) -> Subscription? { + return try! FfiConverterOptionTypeSubscription.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_lorocounter_subscribe(self.uniffiClonePointer(), + FfiConverterTypeSubscriber.lower(subscriber),$0 + ) +}) +} + } @@ -3644,6 +3697,22 @@ public protocol LoroDocProtocol : AnyObject { */ func peerId() -> UInt64 + /** + * Redacts sensitive content in JSON updates within the specified version range. + * + * This function allows you to share document history while removing potentially sensitive content. + * It preserves the document structure and collaboration capabilities while replacing content with + * placeholders according to these redaction rules: + * + * - Preserves delete and move operations + * - Replaces text insertion content with the Unicode replacement character + * - Substitutes list and map insert values with null + * - Maintains structure of child containers + * - Replaces text mark values with null + * - Preserves map keys and text annotation keys + */ + func redactJsonUpdates(json: String, versionRange: VersionRange) throws -> String + /** * Revert the current document state back to the target version * @@ -4704,6 +4773,29 @@ open func peerId() -> UInt64 { uniffi_loro_ffi_fn_method_lorodoc_peer_id(self.uniffiClonePointer(),$0 ) }) +} + + /** + * Redacts sensitive content in JSON updates within the specified version range. + * + * This function allows you to share document history while removing potentially sensitive content. + * It preserves the document structure and collaboration capabilities while replacing content with + * placeholders according to these redaction rules: + * + * - Preserves delete and move operations + * - Replaces text insertion content with the Unicode replacement character + * - Substitutes list and map insert values with null + * - Maintains structure of child containers + * - Replaces text mark values with null + * - Preserves map keys and text annotation keys + */ +open func redactJsonUpdates(json: String, versionRange: VersionRange)throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeLoroError.lift) { + uniffi_loro_ffi_fn_method_lorodoc_redact_json_updates(self.uniffiClonePointer(), + FfiConverterString.lower(json), + FfiConverterTypeVersionRange.lower(versionRange),$0 + ) +}) } /** @@ -5115,6 +5207,21 @@ public protocol LoroListProtocol : AnyObject { func push(v: LoroValueLike) throws + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + func subscribe(subscriber: Subscriber) -> Subscription? + /** * Converts the LoroList to a Vec of LoroValue. * @@ -5408,6 +5515,27 @@ open func push(v: LoroValueLike)throws {try rustCallWithError(FfiConverterTypeL FfiConverterTypeLoroValueLike.lower(v),$0 ) } +} + + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ +open func subscribe(subscriber: Subscriber) -> Subscription? { + return try! FfiConverterOptionTypeSubscription.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_lorolist_subscribe(self.uniffiClonePointer(), + FfiConverterTypeSubscriber.lower(subscriber),$0 + ) +}) } /** @@ -5588,6 +5716,21 @@ public protocol LoroMapProtocol : AnyObject { */ func len() -> UInt32 + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + func subscribe(subscriber: Subscriber) -> Subscription? + /** * Get the values of the map. */ @@ -5923,6 +6066,27 @@ open func len() -> UInt32 { uniffi_loro_ffi_fn_method_loromap_len(self.uniffiClonePointer(),$0 ) }) +} + + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ +open func subscribe(subscriber: Subscriber) -> Subscription? { + return try! FfiConverterOptionTypeSubscription.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_loromap_subscribe(self.uniffiClonePointer(), + FfiConverterTypeSubscriber.lower(subscriber),$0 + ) +}) } /** @@ -6128,6 +6292,21 @@ public protocol LoroMovableListProtocol : AnyObject { func setTreeContainer(pos: UInt32, child: LoroTree) throws -> LoroTree + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + func subscribe(subscriber: Subscriber) -> Subscription? + /** * Get the elements of the list as a vector of LoroValues. * @@ -6532,6 +6711,27 @@ open func setTreeContainer(pos: UInt32, child: LoroTree)throws -> LoroTree { FfiConverterTypeLoroTree.lower(child),$0 ) }) +} + + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ +open func subscribe(subscriber: Subscriber) -> Subscription? { + return try! FfiConverterOptionTypeSubscription.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_loromovablelist_subscribe(self.uniffiClonePointer(), + FfiConverterTypeSubscriber.lower(subscriber),$0 + ) +}) } /** @@ -6612,6 +6812,11 @@ public protocol LoroTextProtocol : AnyObject { */ func applyDelta(delta: [TextDelta]) throws + /** + * Get the characters at given unicode position. + */ + func charAt(pos: UInt32) throws -> String + /** * Delete a range of text at the given unicode position with unicode length. */ @@ -6740,6 +6945,21 @@ public protocol LoroTextProtocol : AnyObject { */ func splice(pos: UInt32, len: UInt32, s: String) throws -> String + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + func subscribe(subscriber: Subscriber) -> Subscription? + /** * Get the text in [Delta](https://quilljs.com/docs/delta/) format. */ @@ -6861,6 +7081,17 @@ open func applyDelta(delta: [TextDelta])throws {try rustCallWithError(FfiConver FfiConverterSequenceTypeTextDelta.lower(delta),$0 ) } +} + + /** + * Get the characters at given unicode position. + */ +open func charAt(pos: UInt32)throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeLoroError.lift) { + uniffi_loro_ffi_fn_method_lorotext_char_at(self.uniffiClonePointer(), + FfiConverterUInt32.lower(pos),$0 + ) +}) } /** @@ -7104,6 +7335,27 @@ open func splice(pos: UInt32, len: UInt32, s: String)throws -> String { FfiConverterString.lower(s),$0 ) }) +} + + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ +open func subscribe(subscriber: Subscriber) -> Subscription? { + return try! FfiConverterOptionTypeSubscription.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_lorotext_subscribe(self.uniffiClonePointer(), + FfiConverterTypeSubscriber.lower(subscriber),$0 + ) +}) } /** @@ -7413,6 +7665,21 @@ public protocol LoroTreeProtocol : AnyObject { */ func roots() -> [TreeId] + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ + func subscribe(subscriber: Subscriber) -> Subscription? + } open class LoroTree: @@ -7799,6 +8066,27 @@ open func roots() -> [TreeId] { }) } + /** + * Subscribe the events of a container. + * + * The callback will be invoked when the container is changed. + * Returns a subscription that can be used to unsubscribe. + * + * The events will be emitted after a transaction is committed. A transaction is committed when: + * + * - `doc.commit()` is called. + * - `doc.export(mode)` is called. + * - `doc.import(data)` is called. + * - `doc.checkout(version)` is called. + */ +open func subscribe(subscriber: Subscriber) -> Subscription? { + return try! FfiConverterOptionTypeSubscription.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_lorotree_subscribe(self.uniffiClonePointer(), + FfiConverterTypeSubscriber.lower(subscriber),$0 + ) +}) +} + } @@ -9157,6 +9445,11 @@ public protocol UndoManagerProtocol : AnyObject { */ func redo() throws -> Bool + /** + * How many times the undo manager can redo. + */ + func redoCount() -> UInt32 + /** * Set the maximum number of undo steps. The default value is 100. */ @@ -9184,6 +9477,11 @@ public protocol UndoManagerProtocol : AnyObject { */ func undo() throws -> Bool + /** + * How many times the undo manager can undo. + */ + func undoCount() -> UInt32 + } open class UndoManager: @@ -9295,6 +9593,16 @@ open func redo()throws -> Bool { uniffi_loro_ffi_fn_method_undomanager_redo(self.uniffiClonePointer(),$0 ) }) +} + + /** + * How many times the undo manager can redo. + */ +open func redoCount() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_undomanager_redo_count(self.uniffiClonePointer(),$0 + ) +}) } /** @@ -9349,6 +9657,16 @@ open func undo()throws -> Bool { }) } + /** + * How many times the undo manager can undo. + */ +open func undoCount() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_undomanager_undo_count(self.uniffiClonePointer(),$0 + ) +}) +} + } @@ -9790,11 +10108,314 @@ public func FfiConverterTypeValueOrContainer_lower(_ value: ValueOrContainer) -> -public protocol VersionVectorProtocol : AnyObject { - - func diff(rhs: VersionVector) -> VersionVectorDiff +public protocol VersionRangeProtocol : AnyObject { - func encode() -> Data + /** + * Clear all ranges in the VersionRange + */ + func clear() + + /** + * Check if this VersionRange contains a specific ID + */ + func containsId(id: Id) -> Bool + + /** + * Check if this VersionRange contains a specific ID span + */ + func containsIdSpan(span: IdSpan) -> Bool + + /** + * Check if this VersionRange contains operations between two VersionVectors + */ + func containsOpsBetween(vvA: VersionVector, vvB: VersionVector) -> Bool + + /** + * Extend this VersionRange to include the given ID span + */ + func extendsToIncludeIdSpan(span: IdSpan) + + /** + * Get the counter range for a specific peer + * Returns the counter range if the peer exists, null otherwise + */ + func get(peer: UInt64) -> CounterSpan? + + /** + * Get all ranges as a list of (peer, start, end) tuples + */ + func getAllRanges() -> [VersionRangeItem] + + /** + * Get all peer IDs in this VersionRange + */ + func getPeers() -> [UInt64] + + /** + * Check if this VersionRange has overlap with the given ID span + */ + func hasOverlapWith(span: IdSpan) -> Bool + + /** + * Insert a counter range for a specific peer + */ + func insert(peer: UInt64, start: Int32, end: Int32) + + /** + * Check if the VersionRange is empty + */ + func isEmpty() -> Bool + +} + +open class VersionRange: + VersionRangeProtocol { + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + 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 public 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. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiClonePointer() -> UnsafeMutableRawPointer { + return try! rustCall { uniffi_loro_ffi_fn_clone_versionrange(self.pointer, $0) } + } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_loro_ffi_fn_constructor_versionrange_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} + + deinit { + guard let pointer = pointer else { + return + } + + try! rustCall { uniffi_loro_ffi_fn_free_versionrange(pointer, $0) } + } + + + /** + * Create a VersionRange from a VersionVector + */ +public static func fromVv(vv: VersionVector) -> VersionRange { + return try! FfiConverterTypeVersionRange.lift(try! rustCall() { + uniffi_loro_ffi_fn_constructor_versionrange_from_vv( + FfiConverterTypeVersionVector.lower(vv),$0 + ) +}) +} + + + + /** + * Clear all ranges in the VersionRange + */ +open func clear() {try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_clear(self.uniffiClonePointer(),$0 + ) +} +} + + /** + * Check if this VersionRange contains a specific ID + */ +open func containsId(id: Id) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_contains_id(self.uniffiClonePointer(), + FfiConverterTypeID.lower(id),$0 + ) +}) +} + + /** + * Check if this VersionRange contains a specific ID span + */ +open func containsIdSpan(span: IdSpan) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_contains_id_span(self.uniffiClonePointer(), + FfiConverterTypeIdSpan.lower(span),$0 + ) +}) +} + + /** + * Check if this VersionRange contains operations between two VersionVectors + */ +open func containsOpsBetween(vvA: VersionVector, vvB: VersionVector) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_contains_ops_between(self.uniffiClonePointer(), + FfiConverterTypeVersionVector.lower(vvA), + FfiConverterTypeVersionVector.lower(vvB),$0 + ) +}) +} + + /** + * Extend this VersionRange to include the given ID span + */ +open func extendsToIncludeIdSpan(span: IdSpan) {try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_extends_to_include_id_span(self.uniffiClonePointer(), + FfiConverterTypeIdSpan.lower(span),$0 + ) +} +} + + /** + * Get the counter range for a specific peer + * Returns the counter range if the peer exists, null otherwise + */ +open func get(peer: UInt64) -> CounterSpan? { + return try! FfiConverterOptionTypeCounterSpan.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_get(self.uniffiClonePointer(), + FfiConverterUInt64.lower(peer),$0 + ) +}) +} + + /** + * Get all ranges as a list of (peer, start, end) tuples + */ +open func getAllRanges() -> [VersionRangeItem] { + return try! FfiConverterSequenceTypeVersionRangeItem.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_get_all_ranges(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Get all peer IDs in this VersionRange + */ +open func getPeers() -> [UInt64] { + return try! FfiConverterSequenceUInt64.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_get_peers(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Check if this VersionRange has overlap with the given ID span + */ +open func hasOverlapWith(span: IdSpan) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_has_overlap_with(self.uniffiClonePointer(), + FfiConverterTypeIdSpan.lower(span),$0 + ) +}) +} + + /** + * Insert a counter range for a specific peer + */ +open func insert(peer: UInt64, start: Int32, end: Int32) {try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_insert(self.uniffiClonePointer(), + FfiConverterUInt64.lower(peer), + FfiConverterInt32.lower(start), + FfiConverterInt32.lower(end),$0 + ) +} +} + + /** + * Check if the VersionRange is empty + */ +open func isEmpty() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_loro_ffi_fn_method_versionrange_is_empty(self.uniffiClonePointer(),$0 + ) +}) +} + + +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeVersionRange: FfiConverter { + + typealias FfiType = UnsafeMutableRawPointer + typealias SwiftType = VersionRange + + public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> VersionRange { + return VersionRange(unsafeFromRawPointer: pointer) + } + + public static func lower(_ value: VersionRange) -> UnsafeMutableRawPointer { + return value.uniffiClonePointer() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> VersionRange { + let v: UInt64 = try readInt(&buf) + // The Rust code won't compile if a pointer won't fit in a UInt64. + // We have to go via `UInt` because that's the thing that's the size of a pointer. + let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) + if (ptr == nil) { + throw UniffiInternalError.unexpectedNullPointer + } + return try lift(ptr!) + } + + public static func write(_ value: VersionRange, into buf: inout [UInt8]) { + // This fiddling is because `Int` is the thing that's the same size as a pointer. + // The Rust code won't compile if a pointer won't fit in a `UInt64`. + writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) + } +} + + + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeVersionRange_lift(_ pointer: UnsafeMutableRawPointer) throws -> VersionRange { + return try FfiConverterTypeVersionRange.lift(pointer) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeVersionRange_lower(_ value: VersionRange) -> UnsafeMutableRawPointer { + return FfiConverterTypeVersionRange.lower(value) +} + + + + +public protocol VersionVectorProtocol : AnyObject { + + func diff(rhs: VersionVector) -> VersionVectorDiff + + func encode() -> Data func eq(other: VersionVector) -> Bool @@ -11940,6 +12561,80 @@ public func FfiConverterTypeUpdateOptions_lower(_ value: UpdateOptions) -> RustB } +public struct VersionRangeItem { + public var peer: UInt64 + public var start: Int32 + public var end: Int32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(peer: UInt64, start: Int32, end: Int32) { + self.peer = peer + self.start = start + self.end = end + } +} + + +extension VersionRangeItem: Sendable {} +extension VersionRangeItem: Equatable, Hashable { + public static func ==(lhs: VersionRangeItem, rhs: VersionRangeItem) -> Bool { + if lhs.peer != rhs.peer { + return false + } + if lhs.start != rhs.start { + return false + } + if lhs.end != rhs.end { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(peer) + hasher.combine(start) + hasher.combine(end) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeVersionRangeItem: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> VersionRangeItem { + return + try VersionRangeItem( + peer: FfiConverterUInt64.read(from: &buf), + start: FfiConverterInt32.read(from: &buf), + end: FfiConverterInt32.read(from: &buf) + ) + } + + public static func write(_ value: VersionRangeItem, into buf: inout [UInt8]) { + FfiConverterUInt64.write(value.peer, into: &buf) + FfiConverterInt32.write(value.start, into: &buf) + FfiConverterInt32.write(value.end, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeVersionRangeItem_lift(_ buf: RustBuffer) throws -> VersionRangeItem { + return try FfiConverterTypeVersionRangeItem.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeVersionRangeItem_lower(_ value: VersionRangeItem) -> RustBuffer { + return FfiConverterTypeVersionRangeItem.lower(value) +} + + public struct VersionVectorDiff { /** * need to add these spans to move from right to left @@ -14396,6 +15091,30 @@ fileprivate struct FfiConverterOptionTypeOnPush: FfiConverterRustBuffer { } } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeSubscription: FfiConverterRustBuffer { + typealias SwiftType = Subscription? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeSubscription.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeSubscription.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + #if swift(>=5.8) @_documentation(visibility: private) #endif @@ -15105,6 +15824,31 @@ fileprivate struct FfiConverterSequenceTypeTreeID: FfiConverterRustBuffer { } } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeVersionRangeItem: FfiConverterRustBuffer { + typealias SwiftType = [VersionRangeItem] + + public static func write(_ value: [VersionRangeItem], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeVersionRangeItem.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [VersionRangeItem] { + let len: Int32 = try readInt(&buf) + var seq = [VersionRangeItem]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeVersionRangeItem.read(from: &buf)) + } + return seq + } +} + #if swift(>=5.8) @_documentation(visibility: private) #endif @@ -15426,6 +16170,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_containeridlike_as_container_id() != 5805) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_cursor_encode() != 36128) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_diffbatch_get_diff() != 5540) { return InitializationResult.apiChecksumMismatch } @@ -15510,6 +16257,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_lorocounter_is_deleted() != 38594) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_lorocounter_subscribe() != 60261) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_lorodoc_apply_diff() != 15296) { return InitializationResult.apiChecksumMismatch } @@ -15699,6 +16449,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_lorodoc_peer_id() != 5346) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_lorodoc_redact_json_updates() != 33049) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_lorodoc_revert_to() != 13908) { return InitializationResult.apiChecksumMismatch } @@ -15825,6 +16578,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_lorolist_push() != 48242) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_lorolist_subscribe() != 37781) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_lorolist_to_vec() != 48551) { return InitializationResult.apiChecksumMismatch } @@ -15909,6 +16665,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_loromap_len() != 39413) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_loromap_subscribe() != 52134) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_loromap_values() != 59291) { return InitializationResult.apiChecksumMismatch } @@ -16011,12 +16770,18 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_loromovablelist_set_tree_container() != 10601) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_loromovablelist_subscribe() != 31212) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_loromovablelist_to_vec() != 22764) { return InitializationResult.apiChecksumMismatch } if (uniffi_loro_ffi_checksum_method_lorotext_apply_delta() != 31013) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_lorotext_char_at() != 49891) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_lorotext_delete() != 50707) { return InitializationResult.apiChecksumMismatch } @@ -16077,6 +16842,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_lorotext_splice() != 53391) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_lorotext_subscribe() != 55608) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_lorotext_to_delta() != 49666) { return InitializationResult.apiChecksumMismatch } @@ -16173,6 +16941,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_lorotree_roots() != 6925) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_lorotree_subscribe() != 4481) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_lorounknown_id() != 45333) { return InitializationResult.apiChecksumMismatch } @@ -16218,6 +16989,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_undomanager_redo() != 52607) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_undomanager_redo_count() != 12383) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_undomanager_set_max_undo_steps() != 20261) { return InitializationResult.apiChecksumMismatch } @@ -16233,6 +17007,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_undomanager_undo() != 51407) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_undomanager_undo_count() != 43432) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_unsubscriber_on_unsubscribe() != 64065) { return InitializationResult.apiChecksumMismatch } @@ -16272,6 +17049,39 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_method_valueorcontainer_is_value() != 20846) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_method_versionrange_clear() != 22575) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_contains_id() != 4971) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_contains_id_span() != 52504) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_contains_ops_between() != 61529) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_extends_to_include_id_span() != 16625) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_get() != 50783) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_get_all_ranges() != 20760) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_get_peers() != 40505) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_has_overlap_with() != 65383) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_insert() != 44262) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_method_versionrange_is_empty() != 60658) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_method_versionvector_diff() != 2647) { return InitializationResult.apiChecksumMismatch } @@ -16314,6 +17124,9 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_constructor_awareness_new() != 18821) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_constructor_cursor_decode() != 31913) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_constructor_cursor_new() != 32460) { return InitializationResult.apiChecksumMismatch } @@ -16371,6 +17184,12 @@ private var initializationResult: InitializationResult = { if (uniffi_loro_ffi_checksum_constructor_undomanager_new() != 31025) { return InitializationResult.apiChecksumMismatch } + if (uniffi_loro_ffi_checksum_constructor_versionrange_from_vv() != 10426) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_loro_ffi_checksum_constructor_versionrange_new() != 7136) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_loro_ffi_checksum_constructor_versionvector_decode() != 54438) { return InitializationResult.apiChecksumMismatch } diff --git a/loro-ffi b/loro-ffi deleted file mode 160000 index 9fd4bce..0000000 --- a/loro-ffi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9fd4bce14c9102cd5e83c50d1be5fe88ebdafd95 diff --git a/loro-swift/Cargo.lock b/loro-swift/Cargo.lock new file mode 100644 index 0000000..887bc7f --- /dev/null +++ b/loro-swift/Cargo.lock @@ -0,0 +1,2049 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "append-only-bytes" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac436601d6bdde674a0d7fb593e829ffe7b3387c351b356dd20e2d40f5bf3ee5" + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "arref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ccd462b64c3c72f1be8305905a85d85403d768e8690c9b8bd3b9009a5761679" + +[[package]] +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", +] + +[[package]] +name = "askama_derive" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn 2.0.103", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +dependencies = [ + "nom", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "bumpalo" +version = "3.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "camino" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "clap" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.103", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "ensure-cov" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33753185802e107b8fa907192af1f0eca13b1fb33327a59266d650fef29b2b4e" + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generator" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18470a76cb7f8ff746cf1f7470914f900252ec36bbc40b569d74b1258446827" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows", +] + +[[package]] +name = "generic-btree" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "210507e6dec78bb1304e52a174bd99efdd83894219bf20d656a066a0ce2fedc5" +dependencies = [ + "arref", + "fxhash", + "heapless 0.7.17", + "itertools 0.11.0", + "loro-thunderdome", + "proc-macro2", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "goblin" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core", + "rand_xoshiro", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "loro" +version = "1.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053d0eb248ff645aeba2b3d88ca5bca4404ae1be4f7819185e21d1762682440f" +dependencies = [ + "enum-as-inner 0.6.1", + "fxhash", + "generic-btree", + "loro-common", + "loro-delta", + "loro-internal", + "loro-kv-store", + "tracing", +] + +[[package]] +name = "loro-common" +version = "1.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b84787030d7925d43f125841d3ce7e4850ffac80d2687cdaa9fd571e67129b" +dependencies = [ + "arbitrary", + "enum-as-inner 0.6.1", + "fxhash", + "leb128", + "loro-rle", + "nonmax", + "serde", + "serde_columnar", + "serde_json", + "thiserror", +] + +[[package]] +name = "loro-delta" +version = "1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9b920ad564430b2e392ac6f0e8f97ef5745960cc40edc482be57a407db1c243" +dependencies = [ + "arrayvec", + "enum-as-inner 0.5.1", + "generic-btree", + "heapless 0.8.0", +] + +[[package]] +name = "loro-ffi" +version = "1.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d35f3cd147018877a374edac0f57725aaa29db25adb65de3729c7b69ced863" +dependencies = [ + "loro", + "serde_json", + "uniffi", +] + +[[package]] +name = "loro-internal" +version = "1.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1467b6b499e3d41909cbf524a5000bcbbc21af1205d2ee20290bed140395124b" +dependencies = [ + "append-only-bytes", + "arref", + "bytes", + "either", + "ensure-cov", + "enum-as-inner 0.6.1", + "enum_dispatch", + "fxhash", + "generic-btree", + "getrandom 0.2.16", + "im", + "itertools 0.12.1", + "leb128", + "loom", + "loro-common", + "loro-delta", + "loro-kv-store", + "loro-rle", + "loro_fractional_index", + "md5", + "nonmax", + "num", + "num-traits", + "once_cell", + "postcard", + "pretty_assertions", + "rand", + "serde", + "serde_columnar", + "serde_json", + "smallvec", + "thiserror", + "thread_local", + "tracing", + "wasm-bindgen", + "xxhash-rust", +] + +[[package]] +name = "loro-kv-store" +version = "1.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa1e5fe58c0245e62775784b6ac69cbe04a081f3348ec3b9742ecc7901085c18" +dependencies = [ + "bytes", + "ensure-cov", + "fxhash", + "loro-common", + "lz4_flex", + "once_cell", + "quick_cache", + "tracing", + "xxhash-rust", +] + +[[package]] +name = "loro-rle" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "077b51e4eac04e7f18574f7e6ac0201ffd98ff65015343eee3702bc3e7c49dc8" +dependencies = [ + "append-only-bytes", + "num", + "smallvec", +] + +[[package]] +name = "loro-swift" +version = "0.1.0" +dependencies = [ + "loro-ffi", + "uniffi", +] + +[[package]] +name = "loro-thunderdome" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3d053a135388e6b1df14e8af1212af5064746e9b87a06a345a7a779ee9695a" + +[[package]] +name = "loro_fractional_index" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e387a04d7d6a74ebb3434c906c84ddcae4413e5ef8bcd8e7d5138959d416a512" +dependencies = [ + "once_cell", + "rand", + "serde", +] + +[[package]] +name = "lz4_flex" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c592ad9fbc1b7838633b3ae55ce69b17d01150c72fcef229fbb819d39ee51ee" +dependencies = [ + "twox-hash", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nonmax" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless 0.7.17", + "serde", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick_cache" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b450dad8382b1b95061d5ca1eb792081fb082adf48c678791fe917509596d5f" +dependencies = [ + "ahash", + "equivalent", + "hashbrown", + "parking_lot", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_columnar" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5910a00acc21b3f106b9e3977cabf8d4c15b62ea585664f08ec6fedb118d88e0" +dependencies = [ + "itertools 0.11.0", + "postcard", + "serde", + "serde_columnar_derive", + "thiserror", +] + +[[package]] +name = "serde_columnar_derive" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44cea1995b758f1b344f484e77a02d9d85c8a62c9ce0e5f1850e27e2f7eebbc9" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "twox-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b907da542cbced5261bd3256de1b3a1bf340a3d37f93425a07362a1d687de56" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "uniffi" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cb08c58c7ed7033150132febe696bef553f891b1ede57424b40d87a89e3c170" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata", + "clap", + "uniffi_bindgen", + "uniffi_build", + "uniffi_core", + "uniffi_macros", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cade167af943e189a55020eda2c314681e223f1e42aca7c4e52614c2b627698f" +dependencies = [ + "anyhow", + "askama", + "camino", + "cargo_metadata", + "fs-err", + "glob", + "goblin", + "heck 0.5.0", + "once_cell", + "paste", + "serde", + "textwrap", + "toml", + "uniffi_meta", + "uniffi_udl", +] + +[[package]] +name = "uniffi_build" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7cf32576e08104b7dc2a6a5d815f37616e66c6866c2a639fe16e6d2286b75b" +dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen", +] + +[[package]] +name = "uniffi_checksum_derive" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" +dependencies = [ + "quote", + "syn 2.0.103", +] + +[[package]] +name = "uniffi_core" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7687007d2546c454d8ae609b105daceb88175477dac280707ad6d95bcd6f1f" +dependencies = [ + "anyhow", + "bytes", + "log", + "once_cell", + "paste", + "static_assertions", +] + +[[package]] +name = "uniffi_macros" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12c65a5b12ec544ef136693af8759fb9d11aefce740fb76916721e876639033b" +dependencies = [ + "bincode", + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", + "serde", + "syn 2.0.103", + "toml", + "uniffi_meta", +] + +[[package]] +name = "uniffi_meta" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a74ed96c26882dac1ca9b93ca23c827e284bacbd7ec23c6f0b0372f747d59e4" +dependencies = [ + "anyhow", + "bytes", + "siphasher", + "uniffi_checksum_derive", +] + +[[package]] +name = "uniffi_testing" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6f984f0781f892cc864a62c3a5c60361b1ccbd68e538e6c9fbced5d82268ac" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata", + "fs-err", + "once_cell", +] + +[[package]] +name = "uniffi_udl" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037820a4cfc4422db1eaa82f291a3863c92c7d1789dc513489c36223f9b4cdfc" +dependencies = [ + "anyhow", + "textwrap", + "uniffi_meta", + "uniffi_testing", + "weedle2", +] + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.103", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "weedle2" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" +dependencies = [ + "nom", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] diff --git a/loro-swift/Cargo.toml b/loro-swift/Cargo.toml new file mode 100644 index 0000000..5dd3674 --- /dev/null +++ b/loro-swift/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "loro-swift" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib", "staticlib"] + +[[bin]] +name = "uniffi-bindgen" +path = "src/uniffi-bindgen.rs" + +[dependencies] +loro-ffi = { version = "1.5.9" } +uniffi = { version = "0.28.3" } + +[build-dependencies] +uniffi = { version = "0.28.3", features = ["build"] } + +[features] +cli = ["uniffi/cli"] diff --git a/loro-swift/src/lib.rs b/loro-swift/src/lib.rs new file mode 100644 index 0000000..45802d8 --- /dev/null +++ b/loro-swift/src/lib.rs @@ -0,0 +1 @@ +loro_ffi::uniffi_reexport_scaffolding!(); diff --git a/loro-swift/src/uniffi-bindgen.rs b/loro-swift/src/uniffi-bindgen.rs new file mode 100644 index 0000000..f6cff6c --- /dev/null +++ b/loro-swift/src/uniffi-bindgen.rs @@ -0,0 +1,3 @@ +fn main() { + uniffi::uniffi_bindgen_main() +} diff --git a/scripts/build_macos.sh b/scripts/build_macos.sh index 578d562..e80f7b0 100755 --- a/scripts/build_macos.sh +++ b/scripts/build_macos.sh @@ -6,8 +6,8 @@ set -euxo pipefail THIS_SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -LIB_NAME="libloro_ffi.a" -RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-ffi" +LIB_NAME="libloro_swift.a" +RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-swift" FRAMEWORK_NAME="loroFFI" SWIFT_FOLDER="$THIS_SCRIPT_DIR/../gen-swift" @@ -19,19 +19,22 @@ XCFRAMEWORK_FOLDER="$THIS_SCRIPT_DIR/../${FRAMEWORK_NAME}.xcframework" echo "▸ Install toolchains" rustup target add aarch64-apple-darwin # macOS ARM/M1 rustup target add x86_64-apple-darwin # macOS Intel/x86 -cargo_build="cargo build --manifest-path $RUST_FOLDER/Cargo.toml" - +cargo_build="cargo build --manifest-path $RUST_FOLDER/Cargo.toml --features cli" echo "▸ Clean state" rm -rf "${XCFRAMEWORK_FOLDER}" rm -rf "${SWIFT_FOLDER}" mkdir -p "${SWIFT_FOLDER}" echo "▸ Generate Swift Scaffolding Code" +cd loro-swift +echo "▸ Build dylib" +$cargo_build -r cargo run -r --manifest-path "$RUST_FOLDER/Cargo.toml" \ --features=cli \ --bin uniffi-bindgen generate \ - "$RUST_FOLDER/src/loro.udl" \ + --library "$RUST_FOLDER/target/release/libloro_swift.dylib" \ --language swift \ - --out-dir "${SWIFT_FOLDER}" \ + --out-dir "${SWIFT_FOLDER}" +cd .. bash "${THIS_SCRIPT_DIR}/refine_trait.sh" diff --git a/scripts/build_swift_ffi.sh b/scripts/build_swift_ffi.sh index 6cab088..3d29cdc 100755 --- a/scripts/build_swift_ffi.sh +++ b/scripts/build_swift_ffi.sh @@ -6,8 +6,8 @@ set -euxo pipefail THIS_SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -LIB_NAME="libloro_ffi.a" -RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-ffi" +LIB_NAME="libloro_swift.a" +RUST_FOLDER="$THIS_SCRIPT_DIR/../loro-swift" FRAMEWORK_NAME="loroFFI" SWIFT_FOLDER="$THIS_SCRIPT_DIR/../gen-swift" @@ -36,22 +36,27 @@ rustup target add aarch64-apple-ios # iOS Device rustup target add aarch64-apple-darwin # macOS ARM/M1 rustup target add x86_64-apple-darwin # macOS Intel/x86 rustup target add wasm32-wasi # WebAssembly -cargo_build="cargo build --manifest-path $RUST_FOLDER/Cargo.toml" -cargo_build_nightly="cargo +${RUST_NIGHTLY} build --manifest-path $RUST_FOLDER/Cargo.toml" -cargo_build_nightly_with_std="cargo -Zbuild-std build --manifest-path $RUST_FOLDER/Cargo.toml" + +cargo_build="cargo build --manifest-path $RUST_FOLDER/Cargo.toml --features cli" +cargo_build_nightly="cargo +${RUST_NIGHTLY} build --manifest-path $RUST_FOLDER/Cargo.toml --features cli" +cargo_build_nightly_with_std="cargo -Zbuild-std build --manifest-path $RUST_FOLDER/Cargo.toml --features cli" echo "▸ Clean state" rm -rf "${XCFRAMEWORK_FOLDER}" rm -rf "${SWIFT_FOLDER}" mkdir -p "${SWIFT_FOLDER}" echo "▸ Generate Swift Scaffolding Code" +cd loro-swift +echo "▸ Build dylib" +$cargo_build -r cargo run --manifest-path "$RUST_FOLDER/Cargo.toml" \ --features=cli \ --bin uniffi-bindgen generate \ - "$RUST_FOLDER/src/loro.udl" \ + --library "$RUST_FOLDER/target/release/libloro_swift.dylib" \ --no-format \ --language swift \ --out-dir "${SWIFT_FOLDER}" +cd .. bash "${THIS_SCRIPT_DIR}/refine_trait.sh"