From 3043009f681f8b14e7b0468d11411849d19d2924 Mon Sep 17 00:00:00 2001 From: Ben Dean-Kawamura Date: Mon, 30 Sep 2024 16:07:06 -0400 Subject: [PATCH] Hide internal classes generated docs Some of these could be made internal, but most could not. The reason is that UniFFI code needs to import them from other modules in order to support external types. This change mostly adds docstrings/annotations to hide them from the generated docs. For swift, this needed to behind an `#if` statement to keep compatability with 5.5. Maybe we can up the minimum version with the next breaking release. --- .../kotlin/templates/BooleanHelper.kt | 3 +++ .../kotlin/templates/ByteArrayHelper.kt | 3 +++ .../templates/CallbackInterfaceRuntime.kt | 3 +++ .../templates/CallbackInterfaceTemplate.kt | 6 ++++- .../kotlin/templates/CustomTypeTemplate.kt | 3 +++ .../kotlin/templates/DurationHelper.kt | 3 +++ .../bindings/kotlin/templates/EnumTemplate.kt | 6 +++++ .../kotlin/templates/ErrorTemplate.kt | 3 +++ .../kotlin/templates/FfiConverterTemplate.kt | 18 +++++++++++---- .../kotlin/templates/Float32Helper.kt | 3 +++ .../kotlin/templates/Float64Helper.kt | 3 +++ .../src/bindings/kotlin/templates/Helpers.kt | 12 ++++++++-- .../bindings/kotlin/templates/Int16Helper.kt | 3 +++ .../bindings/kotlin/templates/Int32Helper.kt | 3 +++ .../bindings/kotlin/templates/Int64Helper.kt | 3 +++ .../bindings/kotlin/templates/Int8Helper.kt | 3 +++ .../bindings/kotlin/templates/MapTemplate.kt | 4 ++++ .../kotlin/templates/ObjectCleanerHelper.kt | 16 ++++++++----- .../kotlin/templates/ObjectTemplate.kt | 3 +++ .../kotlin/templates/OptionalTemplate.kt | 3 +++ .../kotlin/templates/RecordTemplate.kt | 3 +++ .../kotlin/templates/RustBufferTemplate.kt | 7 +++++- .../kotlin/templates/SequenceTemplate.kt | 3 +++ .../bindings/kotlin/templates/StringHelper.kt | 3 +++ .../kotlin/templates/TimestampHelper.kt | 3 +++ .../src/bindings/kotlin/templates/Types.kt | 9 +++++++- .../bindings/kotlin/templates/UInt16Helper.kt | 3 +++ .../bindings/kotlin/templates/UInt32Helper.kt | 3 +++ .../bindings/kotlin/templates/UInt64Helper.kt | 3 +++ .../bindings/kotlin/templates/UInt8Helper.kt | 3 +++ .../swift/templates/BooleanHelper.swift | 3 +++ .../templates/CallbackInterfaceTemplate.swift | 18 +++++++++++++++ .../bindings/swift/templates/CustomType.swift | 13 +++++++++++ .../bindings/swift/templates/DataHelper.swift | 3 +++ .../swift/templates/DurationHelper.swift | 3 +++ .../swift/templates/EnumTemplate.swift | 9 ++++++++ .../swift/templates/ErrorTemplate.swift | 3 +++ .../swift/templates/Float32Helper.swift | 3 +++ .../swift/templates/Float64Helper.swift | 3 +++ .../swift/templates/Int16Helper.swift | 3 +++ .../swift/templates/Int32Helper.swift | 3 +++ .../swift/templates/Int64Helper.swift | 3 +++ .../bindings/swift/templates/Int8Helper.swift | 3 +++ .../swift/templates/MapTemplate.swift | 3 +++ .../swift/templates/ObjectTemplate.swift | 23 ++++++++++++++++++- .../swift/templates/OptionalTemplate.swift | 3 +++ .../swift/templates/RecordTemplate.swift | 9 ++++++++ .../swift/templates/RustBufferTemplate.swift | 12 ++++++++++ .../swift/templates/SequenceTemplate.swift | 3 +++ .../swift/templates/StringHelper.swift | 3 +++ .../swift/templates/TimestampHelper.swift | 3 +++ .../swift/templates/UInt16Helper.swift | 3 +++ .../swift/templates/UInt32Helper.swift | 3 +++ .../swift/templates/UInt64Helper.swift | 3 +++ .../swift/templates/UInt8Helper.swift | 3 +++ 55 files changed, 268 insertions(+), 17 deletions(-) diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/BooleanHelper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/BooleanHelper.kt index c6b266066d..21546a1624 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/BooleanHelper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/BooleanHelper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterBoolean: FfiConverter { override fun lift(value: Byte): Boolean { return value.toInt() != 0 diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/ByteArrayHelper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/ByteArrayHelper.kt index c9449069e2..3f1a34a337 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/ByteArrayHelper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/ByteArrayHelper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterByteArray: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): ByteArray { val len = buf.getInt() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt b/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt index d58a651e24..7f30bc02fd 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt @@ -6,6 +6,9 @@ internal const val UNIFFI_CALLBACK_SUCCESS = 0 internal const val UNIFFI_CALLBACK_ERROR = 1 internal const val UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2 +/** + * @suppress + */ public abstract class FfiConverterCallbackInterface: FfiConverter { internal val handleMap = UniffiHandleMap() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt index d2cdee4f33..6f9b98aa7c 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt @@ -9,5 +9,9 @@ {% include "Interface.kt" %} {% include "CallbackInterfaceImpl.kt" %} -// The ffiConverter which transforms the Callbacks in to handles to pass to Rust. +/** + * The ffiConverter which transforms the Callbacks in to handles to pass to Rust. + * + * @suppress + */ public object {{ ffi_converter_name }}: FfiConverterCallbackInterface<{{ interface_name }}>() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/CustomTypeTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/CustomTypeTemplate.kt index 123535e5c8..9b7d3ac72e 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/CustomTypeTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/CustomTypeTemplate.kt @@ -33,6 +33,9 @@ public typealias {{ type_name }} = {{ concrete_type_name }} {%- else %} {%- endmatch %} +/** + * @suppress + */ public object {{ ffi_converter_name }}: FfiConverter<{{ type_name }}, {{ ffi_type_name }}> { override fun lift(value: {{ ffi_type_name }}): {{ type_name }} { val builtinValue = {{ builtin|lift_fn }}(value) diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/DurationHelper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/DurationHelper.kt index 62e02607f3..522d925b50 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/DurationHelper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/DurationHelper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterDuration: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): java.time.Duration { // Type mismatch (should be u64) but we check for overflow/underflow below diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/EnumTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/EnumTemplate.kt index 1c17799633..4e4153fa3f 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/EnumTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/EnumTemplate.kt @@ -27,6 +27,9 @@ enum class {{ type_name }}(val value: {{ variant_discr_type|type_name(ci) }}) { } {% endmatch %} +/** + * @suppress + */ public object {{ e|ffi_converter_name }}: FfiConverterRustBuffer<{{ type_name }}> { override fun read(buf: ByteBuffer) = try { {% if config.use_enum_entries() %} @@ -84,6 +87,9 @@ sealed class {{ type_name }}{% if contains_object_references %}: Disposable {% e companion object } +/** + * @suppress + */ public object {{ e|ffi_converter_name }} : FfiConverterRustBuffer<{{ type_name }}>{ override fun read(buf: ByteBuffer): {{ type_name }} { return when(buf.getInt()) { diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/ErrorTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/ErrorTemplate.kt index 8c08e765fe..8f517ffeb6 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/ErrorTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/ErrorTemplate.kt @@ -54,6 +54,9 @@ sealed class {{ type_name }}: kotlin.Exception(){% if contains_object_references } {%- endif %} +/** + * @suppress + */ public object {{ e|ffi_converter_name }} : FfiConverterRustBuffer<{{ type_name }}> { override fun read(buf: ByteBuffer): {{ type_name }} { {% if e.is_flat() %} diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/FfiConverterTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/FfiConverterTemplate.kt index 0de90b9c4b..e1c6696de1 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/FfiConverterTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/FfiConverterTemplate.kt @@ -1,7 +1,11 @@ -// The FfiConverter interface handles converter types to and from the FFI -// -// All implementing objects should be public to support external types. When a -// type is external we need to import it's FfiConverter. +/** + * The FfiConverter interface handles converter types to and from the FFI + * + * All implementing objects should be public to support external types. When a + * type is external we need to import it's FfiConverter. + * + * @suppress + */ public interface FfiConverter { // Convert an FFI type to a Kotlin type fun lift(value: FfiType): KotlinType @@ -64,7 +68,11 @@ public interface FfiConverter { } } -// FfiConverter that uses `RustBuffer` as the FfiType +/** + * FfiConverter that uses `RustBuffer` as the FfiType + * + * @suppress + */ public interface FfiConverterRustBuffer: FfiConverter { override fun lift(value: RustBuffer.ByValue) = liftFromRustBuffer(value) override fun lower(value: KotlinType) = lowerIntoRustBuffer(value) diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Float32Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Float32Helper.kt index be91ac8fcb..45f1fb9198 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Float32Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Float32Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterFloat: FfiConverter { override fun lift(value: Float): Float { return value diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Float64Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Float64Helper.kt index 5eb465f0df..81b736ac73 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Float64Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Float64Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterDouble: FfiConverter { override fun lift(value: Double): Double { return value diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Helpers.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Helpers.kt index ca9d98189e..245cc164de 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Helpers.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Helpers.kt @@ -36,7 +36,11 @@ internal open class UniffiRustCallStatus : Structure() { class InternalException(message: String) : kotlin.Exception(message) -// Each top-level error class has a companion object that can lift the error from the call status's rust buffer +/** + * Each top-level error class has a companion object that can lift the error from the call status's rust buffer + * + * @suppress + */ interface UniffiRustCallStatusErrorHandler { fun lift(error_buf: RustBuffer.ByValue): E; } @@ -73,7 +77,11 @@ private fun uniffiCheckCallStatus(errorHandler: UniffiRustC } } -// UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR +/** + * UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR + * + * @suppress + */ object UniffiNullRustCallStatusErrorHandler: UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): InternalException { RustBuffer.free(error_buf) diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Int16Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Int16Helper.kt index de8296fff6..728b8ac65b 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Int16Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Int16Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterShort: FfiConverter { override fun lift(value: Short): Short { return value diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Int32Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Int32Helper.kt index 171809a9c4..c6e1d6f74b 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Int32Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Int32Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterInt: FfiConverter { override fun lift(value: Int): Int { return value diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Int64Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Int64Helper.kt index 35cf8f3169..1d1f65e88e 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Int64Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Int64Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterLong: FfiConverter { override fun lift(value: Long): Long { return value diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Int8Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Int8Helper.kt index 27c98a6659..85d1cd97f7 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Int8Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Int8Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterByte: FfiConverter { override fun lift(value: Byte): Byte { return value diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/MapTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/MapTemplate.kt index a80418eb00..459c932aab 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/MapTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/MapTemplate.kt @@ -1,5 +1,9 @@ {%- let key_type_name = key_type|type_name(ci) %} {%- let value_type_name = value_type|type_name(ci) %} + +/** + * @suppress + */ public object {{ ffi_converter_name }}: FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): Map<{{ key_type_name }}, {{ value_type_name }}> { val len = buf.getInt() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/ObjectCleanerHelper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/ObjectCleanerHelper.kt index e3e85544d7..75986163e8 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/ObjectCleanerHelper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/ObjectCleanerHelper.kt @@ -1,10 +1,14 @@ -// The cleaner interface for Object finalization code to run. -// This is the entry point to any implementation that we're using. -// -// The cleaner registers objects and returns cleanables, so now we are -// defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the -// different implmentations available at compile time. +/** + * The cleaner interface for Object finalization code to run. + * This is the entry point to any implementation that we're using. + * + * The cleaner registers objects and returns cleanables, so now we are + * defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the + * different implmentations available at compile time. + * + * @suppress + */ interface UniffiCleaner { interface Cleanable { fun clean() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/ObjectTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/ObjectTemplate.kt index 72fdbe5648..837b7251c3 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/ObjectTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/ObjectTemplate.kt @@ -262,6 +262,9 @@ open class {{ impl_class_name }}: Disposable, AutoCloseable, {{ interface_name } {% include "CallbackInterfaceImpl.kt" %} {%- endif %} +/** + * @suppress + */ public object {{ ffi_converter_name }}: FfiConverter<{{ type_name }}, Pointer> { {%- if obj.has_callback_interface() %} internal val handleMap = UniffiHandleMap<{{ type_name }}>() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/OptionalTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/OptionalTemplate.kt index 98451e1451..aa46ab3088 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/OptionalTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/OptionalTemplate.kt @@ -1,5 +1,8 @@ {%- let inner_type_name = inner_type|type_name(ci) %} +/** + * @suppress + */ public object {{ ffi_converter_name }}: FfiConverterRustBuffer<{{ inner_type_name }}?> { override fun read(buf: ByteBuffer): {{ inner_type_name }}? { if (buf.get().toInt() == 0) { diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/RecordTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/RecordTemplate.kt index bc3028c736..223e62c144 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/RecordTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/RecordTemplate.kt @@ -36,6 +36,9 @@ class {{ type_name }} { } {%- endif %} +/** + * @suppress + */ public object {{ rec|ffi_converter_name }}: FfiConverterRustBuffer<{{ type_name }}> { override fun read(buf: ByteBuffer): {{ type_name }} { {%- if rec.has_fields() %} diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/RustBufferTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/RustBufferTemplate.kt index b28f25bfc3..c12c386d7c 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/RustBufferTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/RustBufferTemplate.kt @@ -2,6 +2,9 @@ // A rust-owned buffer is represented by its capacity, its current length, and a // pointer to the underlying data. +/** + * @suppress + */ @Structure.FieldOrder("capacity", "len", "data") open class RustBuffer : Structure() { // Note: `capacity` and `len` are actually `ULong` values, but JVM only supports signed values. @@ -54,6 +57,8 @@ open class RustBuffer : Structure() { * Required for callbacks taking in an out pointer. * * Size is the sum of all values in the struct. + * + * @suppress */ class RustBufferByReference : ByReference(16) { /** @@ -88,7 +93,7 @@ class RustBufferByReference : ByReference(16) { // completeness. @Structure.FieldOrder("len", "data") -open class ForeignBytes : Structure() { +internal open class ForeignBytes : Structure() { @JvmField var len: Int = 0 @JvmField var data: Pointer? = null diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/SequenceTemplate.kt b/uniffi_bindgen/src/bindings/kotlin/templates/SequenceTemplate.kt index 61f911cb0c..dab8f22d88 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/SequenceTemplate.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/SequenceTemplate.kt @@ -1,5 +1,8 @@ {%- let inner_type_name = inner_type|type_name(ci) %} +/** + * @suppress + */ public object {{ ffi_converter_name }}: FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List<{{ inner_type_name }}> { val len = buf.getInt() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/StringHelper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/StringHelper.kt index b67435bd1a..ab532421a0 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/StringHelper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/StringHelper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterString: FfiConverter { // Note: we don't inherit from FfiConverterRustBuffer, because we use a // special encoding when lowering/lifting. We can use `RustBuffer.len` to diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/TimestampHelper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/TimestampHelper.kt index 10a450a4bd..217abac566 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/TimestampHelper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/TimestampHelper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterTimestamp: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): java.time.Instant { val seconds = buf.getLong() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/Types.kt b/uniffi_bindgen/src/bindings/kotlin/templates/Types.kt index c27121b701..3555c5f8eb 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/Types.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/Types.kt @@ -18,6 +18,9 @@ interface Disposable { } } +/** + * @suppress + */ inline fun T.use(block: (T) -> R) = try { block(this) @@ -30,7 +33,11 @@ inline fun T.use(block: (T) -> R) = } } -/** Used to instantiate an interface without an actual pointer, for fakes in tests, mostly. */ +/** + * Used to instantiate an interface without an actual pointer, for fakes in tests, mostly. + * + * @suppress + * */ object NoPointer {%- for type_ in ci.iter_types() %} diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/UInt16Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/UInt16Helper.kt index b179145b62..b16a66506e 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/UInt16Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/UInt16Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterUShort: FfiConverter { override fun lift(value: Short): UShort { return value.toUShort() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/UInt32Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/UInt32Helper.kt index 202d5bcd5b..c1c6eb62cd 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/UInt32Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/UInt32Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterUInt: FfiConverter { override fun lift(value: Int): UInt { return value.toUInt() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/UInt64Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/UInt64Helper.kt index 9be2a5a69d..18e09a4c85 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/UInt64Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/UInt64Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterULong: FfiConverter { override fun lift(value: Long): ULong { return value.toULong() diff --git a/uniffi_bindgen/src/bindings/kotlin/templates/UInt8Helper.kt b/uniffi_bindgen/src/bindings/kotlin/templates/UInt8Helper.kt index ee360673e0..7b3eae80f8 100644 --- a/uniffi_bindgen/src/bindings/kotlin/templates/UInt8Helper.kt +++ b/uniffi_bindgen/src/bindings/kotlin/templates/UInt8Helper.kt @@ -1,3 +1,6 @@ +/** + * @suppress + */ public object FfiConverterUByte: FfiConverter { override fun lift(value: Byte): UByte { return value.toUByte() diff --git a/uniffi_bindgen/src/bindings/swift/templates/BooleanHelper.swift b/uniffi_bindgen/src/bindings/swift/templates/BooleanHelper.swift index 465e519628..c5a67e71c9 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/BooleanHelper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/BooleanHelper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterBool : FfiConverter { typealias FfiType = Int8 typealias SwiftType = Bool diff --git a/uniffi_bindgen/src/bindings/swift/templates/CallbackInterfaceTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/CallbackInterfaceTemplate.swift index 7aa1cca9b2..2ea0d35a5f 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/CallbackInterfaceTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/CallbackInterfaceTemplate.swift @@ -12,27 +12,45 @@ {% include "CallbackInterfaceImpl.swift" %} // FfiConverter protocol for callback interfaces +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct {{ ffi_converter_name }} { fileprivate static var handleMap = UniffiHandleMap<{{ type_name }}>() } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif extension {{ ffi_converter_name }} : FfiConverter { typealias SwiftType = {{ type_name }} typealias FfiType = UInt64 +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ handle: UInt64) throws -> SwiftType { try handleMap.get(handle: handle) } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { let handle: UInt64 = try readInt(&buf) return try lift(handle) } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ v: SwiftType) -> UInt64 { return handleMap.insert(obj: v) } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func write(_ v: SwiftType, into buf: inout [UInt8]) { writeInt(&buf, lower(v)) } diff --git a/uniffi_bindgen/src/bindings/swift/templates/CustomType.swift b/uniffi_bindgen/src/bindings/swift/templates/CustomType.swift index 2137ceff9c..d82ece70ac 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/CustomType.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/CustomType.swift @@ -7,6 +7,10 @@ * is needed because the UDL type name is used in function/method signatures. */ public typealias {{ type_name }} = {{ builtin|type_name }} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct FfiConverterType{{ name }}: FfiConverter { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> {{ type_name }} { return try {{ builtin|read_fn }}(from: &buf) @@ -46,6 +50,9 @@ public typealias {{ type_name }} = {{ concrete_type_name }} {%- else %} {%- endmatch %} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct FfiConverterType{{ name }}: FfiConverter { {#- Custom type config supplied, use it to convert the builtin type #} @@ -76,10 +83,16 @@ public struct FfiConverterType{{ name }}: FfiConverter { We always write these public functions just incase the type is used as an external type by another crate. #} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func FfiConverterType{{ name }}_lift(_ value: {{ ffi_type_name }}) throws -> {{ type_name }} { return try FfiConverterType{{ name }}.lift(value) } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func FfiConverterType{{ name }}_lower(_ value: {{ type_name }}) -> {{ ffi_type_name }} { return FfiConverterType{{ name }}.lower(value) } diff --git a/uniffi_bindgen/src/bindings/swift/templates/DataHelper.swift b/uniffi_bindgen/src/bindings/swift/templates/DataHelper.swift index 7db240bf9c..b017c19faf 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/DataHelper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/DataHelper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterData: FfiConverterRustBuffer { typealias SwiftType = Data diff --git a/uniffi_bindgen/src/bindings/swift/templates/DurationHelper.swift b/uniffi_bindgen/src/bindings/swift/templates/DurationHelper.swift index c2aa49e9d1..d729bf0844 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/DurationHelper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/DurationHelper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterDuration: FfiConverterRustBuffer { typealias SwiftType = TimeInterval diff --git a/uniffi_bindgen/src/bindings/swift/templates/EnumTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/EnumTemplate.swift index 1d8b3cf500..94da4efecd 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/EnumTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/EnumTemplate.swift @@ -22,6 +22,9 @@ public enum {{ type_name }} : {{ variant_discr_type|type_name }} { } {% endmatch %} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct {{ ffi_converter_name }}: FfiConverterRustBuffer { typealias SwiftType = {{ type_name }} @@ -66,10 +69,16 @@ public struct {{ ffi_converter_name }}: FfiConverterRustBuffer { We always write these public functions just in case the enum is used as an external type by another crate. #} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func {{ ffi_converter_name }}_lift(_ buf: RustBuffer) throws -> {{ type_name }} { return try {{ ffi_converter_name }}.lift(buf) } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func {{ ffi_converter_name }}_lower(_ value: {{ type_name }}) -> RustBuffer { return {{ ffi_converter_name }}.lower(value) } diff --git a/uniffi_bindgen/src/bindings/swift/templates/ErrorTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/ErrorTemplate.swift index cd4953d8e3..f9a283a078 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/ErrorTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/ErrorTemplate.swift @@ -19,6 +19,9 @@ public enum {{ type_name }} { } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct {{ ffi_converter_name }}: FfiConverterRustBuffer { typealias SwiftType = {{ type_name }} diff --git a/uniffi_bindgen/src/bindings/swift/templates/Float32Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/Float32Helper.swift index fb986beab6..b48664c182 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/Float32Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/Float32Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterFloat: FfiConverterPrimitive { typealias FfiType = Float typealias SwiftType = Float diff --git a/uniffi_bindgen/src/bindings/swift/templates/Float64Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/Float64Helper.swift index 74421c045c..ca9cd42cca 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/Float64Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/Float64Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterDouble: FfiConverterPrimitive { typealias FfiType = Double typealias SwiftType = Double diff --git a/uniffi_bindgen/src/bindings/swift/templates/Int16Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/Int16Helper.swift index ac57fc5e58..e39a0ddb37 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/Int16Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/Int16Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterInt16: FfiConverterPrimitive { typealias FfiType = Int16 typealias SwiftType = Int16 diff --git a/uniffi_bindgen/src/bindings/swift/templates/Int32Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/Int32Helper.swift index 0ccfc13e4e..299a36e7a6 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/Int32Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/Int32Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterInt32: FfiConverterPrimitive { typealias FfiType = Int32 typealias SwiftType = Int32 diff --git a/uniffi_bindgen/src/bindings/swift/templates/Int64Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/Int64Helper.swift index d7d4082933..47f3d8690a 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/Int64Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/Int64Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterInt64: FfiConverterPrimitive { typealias FfiType = Int64 typealias SwiftType = Int64 diff --git a/uniffi_bindgen/src/bindings/swift/templates/Int8Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/Int8Helper.swift index f2387e4340..a3bb799fa0 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/Int8Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/Int8Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterInt8: FfiConverterPrimitive { typealias FfiType = Int8 typealias SwiftType = Int8 diff --git a/uniffi_bindgen/src/bindings/swift/templates/MapTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/MapTemplate.swift index 05713aca26..b9d359cae7 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/MapTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/MapTemplate.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct {{ ffi_converter_name }}: FfiConverterRustBuffer { public static func write(_ value: {{ type_name }}, into buf: inout [UInt8]) { let len = Int32(value.count) diff --git a/uniffi_bindgen/src/bindings/swift/templates/ObjectTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/ObjectTemplate.swift index 6f5a514a6a..aca78cf2c1 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/ObjectTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/ObjectTemplate.swift @@ -28,7 +28,10 @@ open class {{ impl_class_name }}: {{ protocol_name }} { fileprivate let pointer: UnsafeMutableRawPointer! - // Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. + /// 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() {} } @@ -45,10 +48,16 @@ open class {{ impl_class_name }}: // // - 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 { {{ obj.ffi_object_clone().name() }}(self.pointer, $0) } } @@ -118,6 +127,9 @@ open class {{ impl_class_name }}: {% include "CallbackInterfaceImpl.swift" %} {%- endif %} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct {{ ffi_converter_name }}: FfiConverter { {%- if obj.has_callback_interface() %} fileprivate static var handleMap = UniffiHandleMap<{{ type_name }}>() @@ -169,6 +181,9 @@ extension {{ type_name }}: Foundation.LocalizedError { } {# Due to some mismatches in the ffi converter mechanisms, errors are a RustBuffer holding a pointer #} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct {{ ffi_converter_name }}__as_error: FfiConverterRustBuffer { public static func lift(_ buf: RustBuffer) throws -> {{ type_name }} { var reader = createReader(data: Data(rustBuffer: buf)) @@ -193,10 +208,16 @@ public struct {{ ffi_converter_name }}__as_error: FfiConverterRustBuffer { We always write these public functions just in case the enum is used as an external type by another crate. #} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func {{ ffi_converter_name }}_lift(_ pointer: UnsafeMutableRawPointer) throws -> {{ type_name }} { return try {{ ffi_converter_name }}.lift(pointer) } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func {{ ffi_converter_name }}_lower(_ value: {{ type_name }}) -> UnsafeMutableRawPointer { return {{ ffi_converter_name }}.lower(value) } diff --git a/uniffi_bindgen/src/bindings/swift/templates/OptionalTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/OptionalTemplate.swift index 1dac65be63..b4434172ba 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/OptionalTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/OptionalTemplate.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct {{ ffi_converter_name }}: FfiConverterRustBuffer { typealias SwiftType = {{ type_name }} diff --git a/uniffi_bindgen/src/bindings/swift/templates/RecordTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/RecordTemplate.swift index c262a7a216..4d89194238 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/RecordTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/RecordTemplate.swift @@ -35,6 +35,9 @@ extension {{ type_name }}: Equatable, Hashable { } {% endif %} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public struct {{ ffi_converter_name }}: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> {{ type_name }} { return {%- if rec.has_fields() %} @@ -60,10 +63,16 @@ public struct {{ ffi_converter_name }}: FfiConverterRustBuffer { We always write these public functions just in case the struct is used as an external type by another crate. #} +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func {{ ffi_converter_name }}_lift(_ buf: RustBuffer) throws -> {{ type_name }} { return try {{ ffi_converter_name }}.lift(buf) } +#if swift(>=5.8) +@_documentation(visibility: private) +#endif public func {{ ffi_converter_name }}_lower(_ value: {{ type_name }}) -> RustBuffer { return {{ ffi_converter_name }}.lower(value) } diff --git a/uniffi_bindgen/src/bindings/swift/templates/RustBufferTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/RustBufferTemplate.swift index cf8eec4019..025b7bfdfb 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/RustBufferTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/RustBufferTemplate.swift @@ -157,10 +157,16 @@ fileprivate protocol FfiConverter { fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { } extension FfiConverterPrimitive { +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ value: FfiType) throws -> SwiftType { return value } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ value: SwiftType) -> FfiType { return value } @@ -171,6 +177,9 @@ extension FfiConverterPrimitive { fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} extension FfiConverterRustBuffer { +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ buf: RustBuffer) throws -> SwiftType { var reader = createReader(data: Data(rustBuffer: buf)) let value = try read(from: &reader) @@ -181,6 +190,9 @@ extension FfiConverterRustBuffer { return value } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ value: SwiftType) -> RustBuffer { var writer = createWriter() write(value, into: &writer) diff --git a/uniffi_bindgen/src/bindings/swift/templates/SequenceTemplate.swift b/uniffi_bindgen/src/bindings/swift/templates/SequenceTemplate.swift index bf664f6411..5dfc7bdb39 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/SequenceTemplate.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/SequenceTemplate.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct {{ ffi_converter_name }}: FfiConverterRustBuffer { typealias SwiftType = {{ type_name }} diff --git a/uniffi_bindgen/src/bindings/swift/templates/StringHelper.swift b/uniffi_bindgen/src/bindings/swift/templates/StringHelper.swift index b7d3466bdd..c74c54d71a 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/StringHelper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/StringHelper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterString: FfiConverter { typealias SwiftType = String typealias FfiType = RustBuffer diff --git a/uniffi_bindgen/src/bindings/swift/templates/TimestampHelper.swift b/uniffi_bindgen/src/bindings/swift/templates/TimestampHelper.swift index 3cd472fa0e..cdd0113792 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/TimestampHelper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/TimestampHelper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterTimestamp: FfiConverterRustBuffer { typealias SwiftType = Date diff --git a/uniffi_bindgen/src/bindings/swift/templates/UInt16Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/UInt16Helper.swift index b7fc0942a5..4833a36232 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/UInt16Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/UInt16Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterUInt16: FfiConverterPrimitive { typealias FfiType = UInt16 typealias SwiftType = UInt16 diff --git a/uniffi_bindgen/src/bindings/swift/templates/UInt32Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/UInt32Helper.swift index e7a64aab93..2dc6b2b46c 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/UInt32Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/UInt32Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterUInt32: FfiConverterPrimitive { typealias FfiType = UInt32 typealias SwiftType = UInt32 diff --git a/uniffi_bindgen/src/bindings/swift/templates/UInt64Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/UInt64Helper.swift index eb674a2c53..b09d8d6cc7 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/UInt64Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/UInt64Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterUInt64: FfiConverterPrimitive { typealias FfiType = UInt64 typealias SwiftType = UInt64 diff --git a/uniffi_bindgen/src/bindings/swift/templates/UInt8Helper.swift b/uniffi_bindgen/src/bindings/swift/templates/UInt8Helper.swift index 4baf613494..0d53705e39 100644 --- a/uniffi_bindgen/src/bindings/swift/templates/UInt8Helper.swift +++ b/uniffi_bindgen/src/bindings/swift/templates/UInt8Helper.swift @@ -1,3 +1,6 @@ +#if swift(>=5.8) +@_documentation(visibility: private) +#endif fileprivate struct FfiConverterUInt8: FfiConverterPrimitive { typealias FfiType = UInt8 typealias SwiftType = UInt8