Repo: https://github.com/RandyMcMillan/xcode-rust-example.git
.github/workflows/rust.yml
name: CI
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
jobs:
build-test:
strategy:
fail-fast: false
matrix:
include:
# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
# Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# Apple Silicon (arm64)
- os: macos-latest
target: aarch64-apple-darwin
# Apple Silicon (arm64)
- os: macos-14
target: aarch64-apple-darwin
# Apple Silicon (arm64)
- os: macos-15
target: aarch64-apple-darwin
# Apple Silicon (arm64)
- os: macos-26
target: aarch64-apple-darwin
# Intel-based macOS (x86_64)
- os: macos-26-intel
target: x86_64-apple-darwin
# Intel-based macOS (x86_64)
- os: macos-15-intel
target: x86_64-apple-darwin
name: Build & Test (${{ matrix.target }})
runs-on: ${{ matrix.os }}
env:
RA_TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
# Only runs on macOS runners (both Silicon and Intel)
- name: macOS specific setup
#d73a49; font-weight: bold;\">if: contains(matrix.os, 'macos')
run: |
echo #032f62;\">"Running on ${{ matrix.os }}"
./build.sh && make
# Add any additional macOS-specific environment setup here
- name: Build
run: |
cargo build --verbose \
--manifest-path ./rustylib/Cargo.toml \
--target ${{ matrix.target }}
- name: Run tests
run: |
cargo test --verbose \
--manifest-path ./rustylib/Cargo.toml \
--target ${{ matrix.target }}
.gitignore
swiftyapp/Lib/swiftyrustlib/Sources/
.genkit
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,rust,swift,xcode
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,rust,swift,xcode
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
# Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
## Obj-C/Swift specific
*.hmap
## App packaging
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
.build/
# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build/
# Accio dependency management
Dependencies/
.accio/
# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### Xcode ###
## Xcode 8 and earlier
### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings
### SwiftPackageManager ###
Packages
.build/
xcuserdata
DerivedData/
*.xcodeproj
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,rust,swift,xcode
out/
*.xcframework/
.swiftformat
--exclude swiftyapp/Lib/swiftyrustlib/Sources/RustyLib/RustyLib.swift
Makefile
SHELL := /bin/bash
PROJECT := swiftyapp/swiftyapp.xcodeproj
SCHEME := swiftyapp
BUILD_SCRIPT := ./build.sh
RUST_CRATE_DIR := rustylib
DERIVED_DATA ?= .build/xcode
CONFIGURATION ?= Debug
APP_NAME := swiftyapp.app
INSTALL_DIR ?= $(HOME)/Applications
SYMROOT := $(abspath $(DERIVED_DATA))
OBJROOT := $(SYMROOT)/Intermediates.noindex
HOST_ARCH := $(shell uname -m)
SIMULATOR_ARCH := $(#d73a49; font-weight: bold;\">if $(filter arm64,$(HOST_ARCH)),arm64,x86_64)
IOS_DESTINATION ?= generic/platform=iOS Simulator
CATALYST_DESTINATION ?= generic/platform=macOS,variant=Mac Catalyst
CATALYST_APP_PATH := $(SYMROOT)/$(CONFIGURATION)-maccatalyst/$(APP_NAME)
.DEFAULT_GOAL := help
.PHONY: help rust resolve app catalyst install clean
help:
@printf #032f62;\">'%s\n' \
#032f62;\">'make rust - build the Rust library, bindings, and XCFramework' \
#032f62;\">'make resolve - resolve local Swift package dependencies' \
#032f62;\">'make app - build the iOS app for a generic simulator destination' \
#032f62;\">'make catalyst - build the app for Mac Catalyst' \
#032f62;\">'make install - install the Mac Catalyst app into ~/Applications' \
#032f62;\">'make clean - clean Rust and Xcode build artifacts'
rust:
$(BUILD_SCRIPT)
resolve:
xcodebuild -resolvePackageDependencies -project #032f62;\">"$(PROJECT)" -scheme "$(SCHEME)"
app: rust resolve
xcodebuild \
-project #032f62;\">"$(PROJECT)" \
-scheme #032f62;\">"$(SCHEME)" \
-configuration #032f62;\">"$(CONFIGURATION)" \
-derivedDataPath #032f62;\">"$(DERIVED_DATA)" \
SYMROOT=#032f62;\">"$(SYMROOT)" \
OBJROOT=#032f62;\">"$(OBJROOT)" \
-destination #032f62;\">"$(IOS_DESTINATION)" \
ARCHS=#032f62;\">"$(SIMULATOR_ARCH)" \
ONLY_ACTIVE_ARCH=YES \
build
catalyst: rust resolve
xcodebuild \
-project #032f62;\">"$(PROJECT)" \
-scheme #032f62;\">"$(SCHEME)" \
-configuration #032f62;\">"$(CONFIGURATION)" \
-derivedDataPath #032f62;\">"$(DERIVED_DATA)" \
SYMROOT=#032f62;\">"$(SYMROOT)" \
OBJROOT=#032f62;\">"$(OBJROOT)" \
-destination #032f62;\">"$(CATALYST_DESTINATION)" \
ARCHS=#032f62;\">"$(HOST_ARCH)" \
ONLY_ACTIVE_ARCH=YES \
build
install: catalyst
mkdir -p #032f62;\">"$(INSTALL_DIR)"
rm -rf #032f62;\">"$(INSTALL_DIR)/$(APP_NAME)"
cp -R #032f62;\">"$(CATALYST_APP_PATH)" "$(INSTALL_DIR)/$(APP_NAME)"
clean:
cd #032f62;\">"$(RUST_CRATE_DIR)" && cargo clean
rm -rf #032f62;\">"$(DERIVED_DATA)"README.md
# xcode-rust-example

Demonstrates the ability to generate the necessary bindings #d73a49; font-weight: bold;\">for a rust lib compiled for an apple target to be embedded and called by a Swift project in Xcode.
## pre-reqs
1. [cargo](https://rustup.rs/)
1. xcode from [Apple app store](https://apps.apple.com/us/app/xcode/id497799835)
## Setup
`rustylib` rust library with two exposed functions
`swiftyapp` hello world ios app that imports and uses the two rust lib functions
`swiftyrustlib` Swift package of rust lib
1. Run `make rust` (or `./build.sh`).
1. Open the Xcode project located at `swiftyapp/swiftyapp.xcodeproj`.
1. Ensure that RustyLib was successfully imported into project.
1. Build and run the project in Xcode.
1. For Intel Macs, enable and choose the **Mac Catalyst** destination in Xcode.
1. On Apple Silicon Macs, you can also choose **My Mac (Designed #d73a49; font-weight: bold;\">for iPad)** in Xcode.
1. Verify that the Rust library functions are successfully called from the Swift project.
## Make targets
- `make rust` builds the Rust static libraries, Swift bindings, and `RustyCore.xcframework`.
- `make resolve` refreshes the local Swift package reference in Xcode.
- `make app` builds the app #d73a49; font-weight: bold;\">for a generic iOS Simulator destination.
- `make catalyst` builds the app #d73a49; font-weight: bold;\">for Mac Catalyst.
- `make clean` removes Rust and Xcode derived build artifacts.
### Referenced Articles:
- https://boehs.org/node/uniffi
- https://forgen.tech/en/blog/post/building-an-ios-app-with-rust-using-uniffi
- https://krirogn.dev/blog/integrate-rust-in-ios#make-the-library
assets/xcode-rust-example-screenshot.jpg
Skipped: Binary or too large (Size: 68624 bytes).
build.sh
set -euo pipefail
# Xcode runs build phases in a non-login shell, so Cargo/Rustup may not be on PATH.
#d73a49; font-weight: bold;\">export PATH="$HOME/.cargo/bin:/opt/homebrew/bin:/usr/local/bin:${PATH:-/usr/bin:/bin:/usr/sbin:/sbin}"
#d73a49; font-weight: bold;\">if [ -f "$HOME/.cargo/env" ]; then
# shellcheck disable=SC1090
. #032f62;\">"$HOME/.cargo/env"
fi
#d73a49; font-weight: bold;\">if ! command -v cargo >/dev/null 2>&1; then
echo #032f62;\">"cargo not found; install Rust or add cargo to PATH" >&2
exit 127
fi
#d73a49; font-weight: bold;\">if ! command -v rustup >/dev/null 2>&1; then
echo #032f62;\">"rustup not found; install Rust or add rustup to PATH" >&2
exit 127
fi
MY_CRATE=rustylib
SWIFT_APP=swiftyapp
SWIFT_PROJECT=swiftyrustlib
SWIFT_PROJECT_NAME=RustyLib
SWIFT_CORE_NAME=RustyCore
cd $MY_CRATE
# step 1 - compile rust library and generate bindings
HEADERPATH=#032f62;\">"out/${MY_CRATE}FFI.h"
TARGETDIR=#032f62;\">"$(cargo metadata --no-deps --format-version 1 | tr -d '\n' | sed -n 's/.*"target_directory":"\([^"]*\)".*/\1/p')"
TARGETDIR=#032f62;\">"${TARGETDIR:-target}"
RELDIR=#032f62;\">"release"
STATIC_LIB_NAME=#032f62;\">"lib${MY_CRATE}.a"
NEW_HEADER_DIR=#032f62;\">"out/include"
XCFRAMEWORK_PATH=#032f62;\">"${MY_CRATE}_framework.xcframework"
DEVICE_TARGET=#032f62;\">"aarch64-apple-ios"
case #032f62;\">"$(uname -m)" in
arm64)
SIMULATOR_TARGET=#032f62;\">"aarch64-apple-ios-sim"
CATALYST_TARGET=#032f62;\">"aarch64-apple-ios-macabi"
;;
x86_64)
SIMULATOR_TARGET=#032f62;\">"x86_64-apple-ios"
CATALYST_TARGET=#032f62;\">"x86_64-apple-ios-macabi"
;;
*)
echo #032f62;\">"Unsupported host architecture: $(uname -m)" >&2
exit 1
;;
esac
targets=(#032f62;\">"${DEVICE_TARGET}" "${SIMULATOR_TARGET}" "${CATALYST_TARGET}")
#d73a49; font-weight: bold;\">for target in "${targets[@]}"; do
rustup target add ${target}
cargo build --target #032f62;\">"${target}" --release -j8
cargo run --bin uniffi-bindgen generate --library #032f62;\">"${TARGETDIR}/${target}/${RELDIR}/${STATIC_LIB_NAME}" --language swift --out-dir out
done
# step 2 - create xcframework
mkdir -p #032f62;\">"${NEW_HEADER_DIR}"
cp #032f62;\">"${HEADERPATH}" "${NEW_HEADER_DIR}/"
cp #032f62;\">"out/${MY_CRATE}FFI.modulemap" "${NEW_HEADER_DIR}/module.modulemap"
rm -rf #032f62;\">"${XCFRAMEWORK_PATH}"
xcodebuild -create-xcframework \
-library #032f62;\">"${TARGETDIR}/${DEVICE_TARGET}/${RELDIR}/${STATIC_LIB_NAME}" -headers "${NEW_HEADER_DIR}" \
-library #032f62;\">"${TARGETDIR}/${SIMULATOR_TARGET}/${RELDIR}/${STATIC_LIB_NAME}" -headers "${NEW_HEADER_DIR}" \
-library #032f62;\">"${TARGETDIR}/${CATALYST_TARGET}/${RELDIR}/${STATIC_LIB_NAME}" -headers "${NEW_HEADER_DIR}" \
-output #032f62;\">"${XCFRAMEWORK_PATH}"
rm -rf #032f62;\">"${NEW_HEADER_DIR}"
cd ../
SWIFT_LIB_PATH=#032f62;\">"./${SWIFT_APP}/Lib/${SWIFT_PROJECT}"
SWIFT_ARTIFACTS_PATH=#032f62;\">"${SWIFT_LIB_PATH}/artifacts"
SWIFT_SOURCES_PATH=#032f62;\">"${SWIFT_LIB_PATH}/Sources/${SWIFT_PROJECT_NAME}"
# step 3 - move to SwiftLib artifacts
mkdir -p #032f62;\">"${SWIFT_ARTIFACTS_PATH}"
rm -rf #032f62;\">"${SWIFT_ARTIFACTS_PATH}/${SWIFT_CORE_NAME}.xcframework"
cp -R #032f62;\">"./${MY_CRATE}/${XCFRAMEWORK_PATH}" "${SWIFT_ARTIFACTS_PATH}/${SWIFT_CORE_NAME}.xcframework"
# step 4 - move to SwiftLib Sources
mkdir -p #032f62;\">"${SWIFT_SOURCES_PATH}"
cp #032f62;\">"./${MY_CRATE}/out/${MY_CRATE}.swift" "${SWIFT_SOURCES_PATH}/${SWIFT_PROJECT_NAME}.swift"
rustylib/Cargo.lock
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = #032f62;\">"anstream"
version = #032f62;\">"0.6.14"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
dependencies = [
#032f62;\">"anstyle",
#032f62;\">"anstyle-parse",
#032f62;\">"anstyle-query",
#032f62;\">"anstyle-wincon",
#032f62;\">"colorchoice",
#032f62;\">"is_terminal_polyfill",
#032f62;\">"utf8parse",
]
[[package]]
name = #032f62;\">"anstyle"
version = #032f62;\">"1.0.7"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
[[package]]
name = #032f62;\">"anstyle-parse"
version = #032f62;\">"0.2.4"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
dependencies = [
#032f62;\">"utf8parse",
]
[[package]]
name = #032f62;\">"anstyle-query"
version = #032f62;\">"1.1.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
dependencies = [
#032f62;\">"windows-sys",
]
[[package]]
name = #032f62;\">"anstyle-wincon"
version = #032f62;\">"3.0.3"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
dependencies = [
#032f62;\">"anstyle",
#032f62;\">"windows-sys",
]
[[package]]
name = #032f62;\">"anyhow"
version = #032f62;\">"1.0.86"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = #032f62;\">"askama"
version = #032f62;\">"0.12.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28"
dependencies = [
#032f62;\">"askama_derive",
#032f62;\">"askama_escape",
]
[[package]]
name = #032f62;\">"askama_derive"
version = #032f62;\">"0.12.5"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83"
dependencies = [
#032f62;\">"askama_parser",
#032f62;\">"basic-toml",
#032f62;\">"mime",
#032f62;\">"mime_guess",
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"serde",
#032f62;\">"syn",
]
[[package]]
name = #032f62;\">"askama_escape"
version = #032f62;\">"0.10.3"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341"
[[package]]
name = #032f62;\">"askama_parser"
version = #032f62;\">"0.2.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0"
dependencies = [
#032f62;\">"nom",
]
[[package]]
name = #032f62;\">"autocfg"
version = #032f62;\">"1.3.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = #032f62;\">"basic-toml"
version = #032f62;\">"0.1.9"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8"
dependencies = [
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"bincode"
version = #032f62;\">"1.3.3"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"bytes"
version = #032f62;\">"1.6.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
[[package]]
name = #032f62;\">"camino"
version = #032f62;\">"1.1.7"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
dependencies = [
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"cargo-platform"
version = #032f62;\">"0.1.8"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc"
dependencies = [
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"cargo_metadata"
version = #032f62;\">"0.15.4"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a"
dependencies = [
#032f62;\">"camino",
#032f62;\">"cargo-platform",
#032f62;\">"semver",
#032f62;\">"serde",
#032f62;\">"serde_json",
#032f62;\">"thiserror",
]
[[package]]
name = #032f62;\">"clap"
version = #032f62;\">"4.5.9"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462"
dependencies = [
#032f62;\">"clap_builder",
#032f62;\">"clap_derive",
]
[[package]]
name = #032f62;\">"clap_builder"
version = #032f62;\">"4.5.9"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942"
dependencies = [
#032f62;\">"anstream",
#032f62;\">"anstyle",
#032f62;\">"clap_lex",
#032f62;\">"strsim",
]
[[package]]
name = #032f62;\">"clap_derive"
version = #032f62;\">"4.5.8"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
dependencies = [
#032f62;\">"heck",
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"syn",
]
[[package]]
name = #032f62;\">"clap_lex"
version = #032f62;\">"0.7.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
[[package]]
name = #032f62;\">"colorchoice"
version = #032f62;\">"1.0.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
[[package]]
name = #032f62;\">"fs-err"
version = #032f62;\">"2.11.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
dependencies = [
#032f62;\">"autocfg",
]
[[package]]
name = #032f62;\">"glob"
version = #032f62;\">"0.3.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = #032f62;\">"goblin"
version = #032f62;\">"0.8.2"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
dependencies = [
#032f62;\">"log",
#032f62;\">"plain",
#032f62;\">"scroll",
]
[[package]]
name = #032f62;\">"heck"
version = #032f62;\">"0.5.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = #032f62;\">"is_terminal_polyfill"
version = #032f62;\">"1.70.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
[[package]]
name = #032f62;\">"itoa"
version = #032f62;\">"1.0.11"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = #032f62;\">"log"
version = #032f62;\">"0.4.22"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = #032f62;\">"memchr"
version = #032f62;\">"2.7.4"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = #032f62;\">"mime"
version = #032f62;\">"0.3.17"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = #032f62;\">"mime_guess"
version = #032f62;\">"2.0.5"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
dependencies = [
#032f62;\">"mime",
#032f62;\">"unicase",
]
[[package]]
name = #032f62;\">"minimal-lexical"
version = #032f62;\">"0.2.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = #032f62;\">"nom"
version = #032f62;\">"7.1.3"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
#032f62;\">"memchr",
#032f62;\">"minimal-lexical",
]
[[package]]
name = #032f62;\">"once_cell"
version = #032f62;\">"1.19.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = #032f62;\">"paste"
version = #032f62;\">"1.0.15"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = #032f62;\">"plain"
version = #032f62;\">"0.2.3"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
[[package]]
name = #032f62;\">"proc-macro2"
version = #032f62;\">"1.0.86"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
#032f62;\">"unicode-ident",
]
[[package]]
name = #032f62;\">"quote"
version = #032f62;\">"1.0.36"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
#032f62;\">"proc-macro2",
]
[[package]]
name = #032f62;\">"rustylib"
version = #032f62;\">"0.1.0"
dependencies = [
#032f62;\">"uniffi",
]
[[package]]
name = #032f62;\">"ryu"
version = #032f62;\">"1.0.18"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
[[package]]
name = #032f62;\">"scroll"
version = #032f62;\">"0.12.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
dependencies = [
#032f62;\">"scroll_derive",
]
[[package]]
name = #032f62;\">"scroll_derive"
version = #032f62;\">"0.12.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932"
dependencies = [
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"syn",
]
[[package]]
name = #032f62;\">"semver"
version = #032f62;\">"1.0.23"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
dependencies = [
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"serde"
version = #032f62;\">"1.0.204"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
dependencies = [
#032f62;\">"serde_derive",
]
[[package]]
name = #032f62;\">"serde_derive"
version = #032f62;\">"1.0.204"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"syn",
]
[[package]]
name = #032f62;\">"serde_json"
version = #032f62;\">"1.0.120"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
dependencies = [
#032f62;\">"itoa",
#032f62;\">"ryu",
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"siphasher"
version = #032f62;\">"0.3.11"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
[[package]]
name = #032f62;\">"smawk"
version = #032f62;\">"0.3.2"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
[[package]]
name = #032f62;\">"static_assertions"
version = #032f62;\">"1.1.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = #032f62;\">"strsim"
version = #032f62;\">"0.11.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = #032f62;\">"syn"
version = #032f62;\">"2.0.70"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16"
dependencies = [
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"unicode-ident",
]
[[package]]
name = #032f62;\">"textwrap"
version = #032f62;\">"0.16.1"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
dependencies = [
#032f62;\">"smawk",
]
[[package]]
name = #032f62;\">"thiserror"
version = #032f62;\">"1.0.61"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
dependencies = [
#032f62;\">"thiserror-impl",
]
[[package]]
name = #032f62;\">"thiserror-impl"
version = #032f62;\">"1.0.61"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"syn",
]
[[package]]
name = #032f62;\">"toml"
version = #032f62;\">"0.5.11"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
dependencies = [
#032f62;\">"serde",
]
[[package]]
name = #032f62;\">"unicase"
version = #032f62;\">"2.7.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
dependencies = [
#032f62;\">"version_check",
]
[[package]]
name = #032f62;\">"unicode-ident"
version = #032f62;\">"1.0.12"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = #032f62;\">"uniffi"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f31bff6daf87277a9014bcdefbc2842b0553392919d1096843c5aad899ca4588"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"camino",
#032f62;\">"clap",
#032f62;\">"uniffi_bindgen",
#032f62;\">"uniffi_build",
#032f62;\">"uniffi_core",
#032f62;\">"uniffi_macros",
]
[[package]]
name = #032f62;\">"uniffi_bindgen"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"96061d7e01b185aa405f7c9b134741ab3e50cc6796a47d6fd8ab9a5364b5feed"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"askama",
#032f62;\">"camino",
#032f62;\">"cargo_metadata",
#032f62;\">"fs-err",
#032f62;\">"glob",
#032f62;\">"goblin",
#032f62;\">"heck",
#032f62;\">"once_cell",
#032f62;\">"paste",
#032f62;\">"serde",
#032f62;\">"textwrap",
#032f62;\">"toml",
#032f62;\">"uniffi_meta",
#032f62;\">"uniffi_testing",
#032f62;\">"uniffi_udl",
]
[[package]]
name = #032f62;\">"uniffi_build"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"9d6b86f9b221046af0c533eafe09ece04e2f1ded04ccdc9bba0ec09aec1c52bd"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"camino",
#032f62;\">"uniffi_bindgen",
]
[[package]]
name = #032f62;\">"uniffi_checksum_derive"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"2fcfa22f55829d3aaa7acfb1c5150224188fe0f27c59a8a3eddcaa24d1ffbe58"
dependencies = [
#032f62;\">"quote",
#032f62;\">"syn",
]
[[package]]
name = #032f62;\">"uniffi_core"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"3210d57d6ab6065ab47a2898dacdb7c606fd6a4156196831fa3bf82e34ac58a6"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"bytes",
#032f62;\">"camino",
#032f62;\">"log",
#032f62;\">"once_cell",
#032f62;\">"paste",
#032f62;\">"static_assertions",
]
[[package]]
name = #032f62;\">"uniffi_macros"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"b58691741080935437dc862122e68d7414432a11824ac1137868de46181a0bd2"
dependencies = [
#032f62;\">"bincode",
#032f62;\">"camino",
#032f62;\">"fs-err",
#032f62;\">"once_cell",
#032f62;\">"proc-macro2",
#032f62;\">"quote",
#032f62;\">"serde",
#032f62;\">"syn",
#032f62;\">"toml",
#032f62;\">"uniffi_meta",
]
[[package]]
name = #032f62;\">"uniffi_meta"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"7663eacdbd9fbf4a88907ddcfe2e6fa85838eb6dc2418a7d91eebb3786f8e20b"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"bytes",
#032f62;\">"siphasher",
#032f62;\">"uniffi_checksum_derive",
]
[[package]]
name = #032f62;\">"uniffi_testing"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"f922465f7566f25f8fe766920205fdfa9a3fcdc209c6bfb7557f0b5bf45b04dd"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"camino",
#032f62;\">"cargo_metadata",
#032f62;\">"fs-err",
#032f62;\">"once_cell",
]
[[package]]
name = #032f62;\">"uniffi_udl"
version = #032f62;\">"0.28.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"cef408229a3a407fafa4c36dc4f6ece78a6fb258ab28d2b64bddd49c8cb680f6"
dependencies = [
#032f62;\">"anyhow",
#032f62;\">"textwrap",
#032f62;\">"uniffi_meta",
#032f62;\">"uniffi_testing",
#032f62;\">"weedle2",
]
[[package]]
name = #032f62;\">"utf8parse"
version = #032f62;\">"0.2.2"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = #032f62;\">"version_check"
version = #032f62;\">"0.9.4"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = #032f62;\">"weedle2"
version = #032f62;\">"5.0.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
dependencies = [
#032f62;\">"nom",
]
[[package]]
name = #032f62;\">"windows-sys"
version = #032f62;\">"0.52.0"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
#032f62;\">"windows-targets",
]
[[package]]
name = #032f62;\">"windows-targets"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
#032f62;\">"windows_aarch64_gnullvm",
#032f62;\">"windows_aarch64_msvc",
#032f62;\">"windows_i686_gnu",
#032f62;\">"windows_i686_gnullvm",
#032f62;\">"windows_i686_msvc",
#032f62;\">"windows_x86_64_gnu",
#032f62;\">"windows_x86_64_gnullvm",
#032f62;\">"windows_x86_64_msvc",
]
[[package]]
name = #032f62;\">"windows_aarch64_gnullvm"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = #032f62;\">"windows_aarch64_msvc"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = #032f62;\">"windows_i686_gnu"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = #032f62;\">"windows_i686_gnullvm"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = #032f62;\">"windows_i686_msvc"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = #032f62;\">"windows_x86_64_gnu"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = #032f62;\">"windows_x86_64_gnullvm"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = #032f62;\">"windows_x86_64_msvc"
version = #032f62;\">"0.52.6"
source = #032f62;\">"registry+https://github.com/rust-lang/crates.io-index"
checksum = #032f62;\">"589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
rustylib/Cargo.toml
[package]
name = #032f62;\">"rustylib"
version = #032f62;\">"0.1.0"
edition = #032f62;\">"2021"
[lib]
crate-#d73a49; font-weight: bold;\">type = ["cdylib", "staticlib"]
name = #032f62;\">"rustylib"
[[bin]]
name = #032f62;\">"uniffi-bindgen"
path = #032f62;\">"uniffi-bindgen.rs"
[dependencies]
uniffi = { version = #032f62;\">"0.28.0", features = [ "cli" ] }
[build-dependencies]
uniffi = { version = #032f62;\">"0.28.0", features = [ "build" ] }
rustylib/src/lib.rs
uniffi::setup_scaffolding!();
#[uniffi::export]
#d73a49; font-weight: bold;\">fn rust_hello() -> String {
#032f62;\">"Hello from Rust!".to_string()
}
#[uniffi::export]
#d73a49; font-weight: bold;\">pub fn rust_add(a: u32, b: u32) -> u32 {
a + b
}
rustylib/src/rustylib.swift
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!
// swiftlint:disable all
#d73a49; font-weight: bold;\">import Foundation
// Depending on the consumer's build setup, the low-level FFI code
// might be in a separate module, or it might be compiled inline into
// this module. This is a bit of light hackery to work with both.
#if canImport(rustylibFFI)
#d73a49; font-weight: bold;\">import rustylibFFI
#endif
private extension RustBuffer {
// Allocate a new buffer, copying the contents of a `UInt8` array.
init(bytes: [UInt8]) {
#d73a49; font-weight: bold;\">let rbuf = bytes.withUnsafeBufferPointer { ptr in
RustBuffer.from(ptr)
}
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}
static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len: 0, data: nil)
}
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_rustylib_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
// Frees the buffer in place.
// The buffer must not be used after this is called.
func deallocate() {
try! rustCall { ffi_rustylib_rustbuffer_free(self, $0) }
}
}
private extension ForeignBytes {
init(bufferPointer: UnsafeBufferPointer<UInt8>) {
self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress)
}
}
// For every type used in the interface, we provide helper methods for conveniently
// lifting and lowering that type from C-compatible data, and for reading and writing
// values of that type in a buffer.
// Helper classes/extensions that don't change.
// Someday, this will be in a library of its own.
private extension Data {
init(rustBuffer: RustBuffer) {
// TODO: This copies the buffer. Can we read directly from a
// Rust buffer?
self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len))
}
}
// Define reader functionality. Normally this would be defined in a class or
// struct, but we use standalone functions instead in order to make external
// types work.
//
// With external types, one swift source file needs to be able to call the read
// method on another source file's FfiConverter, but then what visibility
// should Reader have?
// - If Reader is fileprivate, then this means the read() must also
// be fileprivate, which doesn't work with external types.
// - If Reader is internal/public, we'll get compile errors since both source
// files will try define the same type.
//
// Instead, the read() method and these helper functions input a tuple of data
private func createReader(data: Data) -> (data: Data, offset: Data.Index) {
(data: data, offset: 0)
}
// Reads an integer at the current offset, in big-endian order, and advances
// the offset on success. Throws if reading the integer would move the
// offset past the end of the buffer.
private func readInt<T: FixedWidthInteger>(_ reader: inout (data: Data, offset: Data.Index)) throws -> T {
#d73a49; font-weight: bold;\">let range = reader.offset ..< reader.offset + MemoryLayout<T>.size
guard reader.data.count >= range.upperBound #d73a49; font-weight: bold;\">else {
throw UniffiInternalError.bufferOverflow
}
#d73a49; font-weight: bold;\">if T.self == UInt8.self {
#d73a49; font-weight: bold;\">let value = reader.data[reader.offset]
reader.offset += 1
#d73a49; font-weight: bold;\">return value as! T
}
#d73a49; font-weight: bold;\">var value: T = 0
#d73a49; font-weight: bold;\">let _ = withUnsafeMutableBytes(of: &value) { reader.data.copyBytes(to: $0, from: range) }
reader.offset = range.upperBound
#d73a49; font-weight: bold;\">return value.bigEndian
}
// Reads an arbitrary number of bytes, to be used to read
// raw bytes, this is useful when lifting strings
private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> [UInt8] {
#d73a49; font-weight: bold;\">let range = reader.offset ..< (reader.offset + count)
guard reader.data.count >= range.upperBound #d73a49; font-weight: bold;\">else {
throw UniffiInternalError.bufferOverflow
}
#d73a49; font-weight: bold;\">var value = [UInt8](repeating: 0, count: count)
value.withUnsafeMutableBufferPointer { buffer in
reader.data.copyBytes(to: buffer, from: range)
}
reader.offset = range.upperBound
#d73a49; font-weight: bold;\">return value
}
// Reads a float at the current offset.
private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float {
#d73a49; font-weight: bold;\">return try Float(bitPattern: readInt(&reader))
}
// Reads a float at the current offset.
private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double {
#d73a49; font-weight: bold;\">return try Double(bitPattern: readInt(&reader))
}
// Indicates if the offset has reached the end of the buffer.
private func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool {
#d73a49; font-weight: bold;\">return reader.offset < reader.data.count
}
// Define writer functionality. Normally this would be defined in a class or
// struct, but we use standalone functions instead in order to make external
// types work. See the above discussion on Readers for details.
private func createWriter() -> [UInt8] {
#d73a49; font-weight: bold;\">return []
}
private func writeBytes<S>(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 {
writer.append(contentsOf: byteArr)
}
// Writes an integer in big-endian order.
//
// Warning: make sure what you are trying to write
// is in the correct type!
private func writeInt<T: FixedWidthInteger>(_ writer: inout [UInt8], _ value: T) {
#d73a49; font-weight: bold;\">var value = value.bigEndian
withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) }
}
private func writeFloat(_ writer: inout [UInt8], _ value: Float) {
writeInt(&writer, value.bitPattern)
}
private func writeDouble(_ writer: inout [UInt8], _ value: Double) {
writeInt(&writer, value.bitPattern)
}
// Protocol for types that transfer other types across the FFI. This is
// analogous to the Rust trait of the same name.
private protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
static func lift(_ value: FfiType) throws -> SwiftType
static func lower(_ value: SwiftType) -> FfiType
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType
static func write(_ value: SwiftType, into buf: inout [UInt8])
}
// Types conforming to `Primitive` pass themselves directly over the FFI.
private protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType {}
extension FfiConverterPrimitive {
public static func lift(_ value: FfiType) throws -> SwiftType {
#d73a49; font-weight: bold;\">return value
}
public static func lower(_ value: SwiftType) -> FfiType {
#d73a49; font-weight: bold;\">return value
}
}
// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`.
// Used for complex types where it's hard to write a custom lift/lower.
private protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {}
extension FfiConverterRustBuffer {
public static func lift(_ buf: RustBuffer) throws -> SwiftType {
#d73a49; font-weight: bold;\">var reader = createReader(data: Data(rustBuffer: buf))
#d73a49; font-weight: bold;\">let value = try read(from: &reader)
#d73a49; font-weight: bold;\">if hasRemaining(reader) {
throw UniffiInternalError.incompleteData
}
buf.deallocate()
#d73a49; font-weight: bold;\">return value
}
public static func lower(_ value: SwiftType) -> RustBuffer {
#d73a49; font-weight: bold;\">var writer = createWriter()
write(value, into: &writer)
#d73a49; font-weight: bold;\">return RustBuffer(bytes: writer)
}
}
// An error type for FFI errors. These errors occur at the UniFFI level, not
// the library level.
private enum UniffiInternalError: LocalizedError {
case bufferOverflow
case incompleteData
case unexpectedOptionalTag
case unexpectedEnumCase
case unexpectedNullPointer
case unexpectedRustCallStatusCode
case unexpectedRustCallError
case unexpectedStaleHandle
case rustPanic(_ message: String)
#d73a49; font-weight: bold;\">var errorDescription: String? {
switch self {
case .bufferOverflow: #d73a49; font-weight: bold;\">return "Reading the requested value would read past the end of the buffer"
case .incompleteData: #d73a49; font-weight: bold;\">return "The buffer still has data after lifting its containing value"
case .unexpectedOptionalTag: #d73a49; font-weight: bold;\">return "Unexpected optional tag; should be 0 or 1"
case .unexpectedEnumCase: #d73a49; font-weight: bold;\">return "Raw enum value doesn't match any cases"
case .unexpectedNullPointer: #d73a49; font-weight: bold;\">return "Raw pointer value was null"
case .unexpectedRustCallStatusCode: #d73a49; font-weight: bold;\">return "Unexpected RustCallStatus code"
case .unexpectedRustCallError: #d73a49; font-weight: bold;\">return "CALL_ERROR but no errorClass specified"
case .unexpectedStaleHandle: #d73a49; font-weight: bold;\">return "The object in the handle map has been dropped already"
case #d73a49; font-weight: bold;\">let .rustPanic(message): return message
}
}
}
private extension NSLock {
func withLock<T>(f: () throws -> T) rethrows -> T {
lock()
defer { self.unlock() }
#d73a49; font-weight: bold;\">return try f()
}
}
private #d73a49; font-weight: bold;\">let CALL_SUCCESS: Int8 = 0
private #d73a49; font-weight: bold;\">let CALL_ERROR: Int8 = 1
private #d73a49; font-weight: bold;\">let CALL_UNEXPECTED_ERROR: Int8 = 2
private #d73a49; font-weight: bold;\">let CALL_CANCELLED: Int8 = 3
private extension RustCallStatus {
init() {
self.init(
code: CALL_SUCCESS,
errorBuf: RustBuffer(
capacity: 0,
len: 0,
data: nil
)
)
}
}
private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
#d73a49; font-weight: bold;\">let neverThrow: ((RustBuffer) throws -> Never)? = nil
#d73a49; font-weight: bold;\">return try makeRustCall(callback, errorHandler: neverThrow)
}
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T
) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
#d73a49; font-weight: bold;\">var callStatus = RustCallStatus()
#d73a49; font-weight: bold;\">let returnedVal = callback(&callStatus)
try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler)
#d73a49; font-weight: bold;\">return returnedVal
}
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
#d73a49; font-weight: bold;\">return
case CALL_ERROR:
#d73a49; font-weight: bold;\">if let errorHandler = errorHandler {
throw try errorHandler(callStatus.errorBuf)
} #d73a49; font-weight: bold;\">else {
callStatus.errorBuf.deallocate()
throw UniffiInternalError.unexpectedRustCallError
}
case CALL_UNEXPECTED_ERROR:
// When the rust code sees a panic, it tries to construct a RustBuffer
// with the message. But if that code panics, then it just sends back
// an empty buffer.
#d73a49; font-weight: bold;\">if callStatus.errorBuf.len > 0 {
throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf))
} #d73a49; font-weight: bold;\">else {
callStatus.errorBuf.deallocate()
throw UniffiInternalError.rustPanic(#032f62;\">"Rust panic")
}
case CALL_CANCELLED:
fatalError(#032f62;\">"Cancellation not supported yet")
default:
throw UniffiInternalError.unexpectedRustCallStatusCode
}
}
private func uniffiTraitInterfaceCall<T>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> Void
) {
do {
try writeReturn(makeCall())
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
private func uniffiTraitInterfaceCallWithError<T, E>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> Void,
lowerError: (E) -> RustBuffer
) {
do {
try writeReturn(makeCall())
} catch #d73a49; font-weight: bold;\">let error as E {
callStatus.pointee.code = CALL_ERROR
callStatus.pointee.errorBuf = lowerError(error)
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
private #d73a49; font-weight: bold;\">class UniffiHandleMap<T> {
private #d73a49; font-weight: bold;\">var map: [UInt64: T] = [:]
private #d73a49; font-weight: bold;\">let lock = NSLock()
private #d73a49; font-weight: bold;\">var currentHandle: UInt64 = 1
func insert(obj: T) -> UInt64 {
lock.withLock {
#d73a49; font-weight: bold;\">let handle = currentHandle
currentHandle += 1
map[handle] = obj
#d73a49; font-weight: bold;\">return handle
}
}
func get(handle: UInt64) throws -> T {
try lock.withLock {
guard #d73a49; font-weight: bold;\">let obj = map[handle] else {
throw UniffiInternalError.unexpectedStaleHandle
}
#d73a49; font-weight: bold;\">return obj
}
}
@discardableResult
func remove(handle: UInt64) throws -> T {
try lock.withLock {
guard #d73a49; font-weight: bold;\">let obj = map.removeValue(forKey: handle) else {
throw UniffiInternalError.unexpectedStaleHandle
}
#d73a49; font-weight: bold;\">return obj
}
}
#d73a49; font-weight: bold;\">var count: Int {
map.count
}
}
// Public interface members begin here.
private #d73a49; font-weight: bold;\">struct FfiConverterUInt32: FfiConverterPrimitive {
typealias FfiType = UInt32
typealias SwiftType = UInt32
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 {
#d73a49; font-weight: bold;\">return try lift(readInt(&buf))
}
static func write(_ value: SwiftType, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
private #d73a49; font-weight: bold;\">struct FfiConverterString: FfiConverter {
typealias SwiftType = String
typealias FfiType = RustBuffer
static func lift(_ value: RustBuffer) throws -> String {
defer {
value.deallocate()
}
#d73a49; font-weight: bold;\">if value.data == nil {
#d73a49; font-weight: bold;\">return String()
}
#d73a49; font-weight: bold;\">let bytes = UnsafeBufferPointer<UInt8>(start: value.data!, count: Int(value.len))
#d73a49; font-weight: bold;\">return String(bytes: bytes, encoding: String.Encoding.utf8)!
}
static func lower(_ value: String) -> RustBuffer {
#d73a49; font-weight: bold;\">return value.utf8CString.withUnsafeBufferPointer { ptr in
// The swift string gives us int8_t, we want uint8_t.
ptr.withMemoryRebound(to: UInt8.self) { ptr in
// The swift string gives us a trailing null byte, we don't want it.
#d73a49; font-weight: bold;\">let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1))
#d73a49; font-weight: bold;\">return RustBuffer.from(buf)
}
}
}
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String {
#d73a49; font-weight: bold;\">let len: Int32 = try readInt(&buf)
#d73a49; font-weight: bold;\">return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)!
}
static func write(_ value: String, into buf: inout [UInt8]) {
#d73a49; font-weight: bold;\">let len = Int32(value.utf8.count)
writeInt(&buf, len)
writeBytes(&buf, value.utf8)
}
}
public func rustAdd(a: UInt32, b: UInt32) -> UInt32 {
#d73a49; font-weight: bold;\">return try! FfiConverterUInt32.lift(try! rustCall {
uniffi_rustylib_fn_func_rust_add(
FfiConverterUInt32.lower(a),
FfiConverterUInt32.lower(b), $0
)
})
}
public func rustHello() -> String {
#d73a49; font-weight: bold;\">return try! FfiConverterString.lift(try! rustCall {
uniffi_rustylib_fn_func_rust_hello($0
)
})
}
private enum InitializationResult {
case ok
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private #d73a49; font-weight: bold;\">var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
#d73a49; font-weight: bold;\">let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
#d73a49; font-weight: bold;\">let scaffolding_contract_version = ffi_rustylib_uniffi_contract_version()
#d73a49; font-weight: bold;\">if bindings_contract_version != scaffolding_contract_version {
#d73a49; font-weight: bold;\">return InitializationResult.contractVersionMismatch
}
#d73a49; font-weight: bold;\">if uniffi_rustylib_checksum_func_rust_add() != 19162 {
#d73a49; font-weight: bold;\">return InitializationResult.apiChecksumMismatch
}
#d73a49; font-weight: bold;\">if uniffi_rustylib_checksum_func_rust_hello() != 12174 {
#d73a49; font-weight: bold;\">return InitializationResult.apiChecksumMismatch
}
#d73a49; font-weight: bold;\">return InitializationResult.ok
}()
private func uniffiEnsureInitialized() {
switch initializationResult {
case .ok:
break
case .contractVersionMismatch:
fatalError(#032f62;\">"UniFFI contract version mismatch: try cleaning and rebuilding your project")
case .apiChecksumMismatch:
fatalError(#032f62;\">"UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
}
// swiftlint:enable all
rustylib/src/rustylibFFI.h
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
// The following structs are used to implement the lowest level
// of the FFI, and thus useful to multiple uniffied crates.
// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H.
#ifdef UNIFFI_SHARED_H
// We also try to prevent mixing versions of shared uniffi header structs.
// If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4
#ifndef UNIFFI_SHARED_HEADER_V4
#error Combining helper code from multiple versions of uniffi is not supported
#endif // ndef UNIFFI_SHARED_HEADER_V4
#else
#define UNIFFI_SHARED_H
#define UNIFFI_SHARED_HEADER_V4
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
typedef #d73a49; font-weight: bold;\">struct RustBuffer
{
uint64_t capacity;
uint64_t len;
uint8_t *_Nullable data;
} RustBuffer;
typedef #d73a49; font-weight: bold;\">struct ForeignBytes
{
int32_t len;
#d73a49; font-weight: bold;\">const uint8_t *_Nullable data;
} ForeignBytes;
// Error definitions
typedef #d73a49; font-weight: bold;\">struct RustCallStatus {
int8_t code;
RustBuffer errorBuf;
} RustCallStatus;
// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
#endif // def UNIFFI_SHARED_H
#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK
#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK
typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE
typedef void (*UniffiForeignFutureFree)(uint64_t
);
#endif
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE
typedef void (*UniffiCallbackInterfaceFree)(uint64_t
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE
#define UNIFFI_FFIDEF_FOREIGN_FUTURE
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFuture {
uint64_t handle;
UniffiForeignFutureFree _Nonnull free;
} UniffiForeignFuture;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructU8 {
uint8_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructU8;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8
typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureStructU8
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructI8 {
int8_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructI8;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8
typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureStructI8
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructU16 {
uint16_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructU16;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16
typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureStructU16
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructI16 {
int16_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructI16;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16
typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureStructI16
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructU32 {
uint32_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructU32;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32
typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureStructU32
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructI32 {
int32_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructI32;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32
typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureStructI32
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructU64 {
uint64_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructU64;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64
typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureStructU64
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructI64 {
int64_t returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructI64;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64
typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureStructI64
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructF32 {
float returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructF32;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32
typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureStructF32
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructF64 {
double returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructF64;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64
typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureStructF64
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructPointer {
void*_Nonnull returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructPointer;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER
typedef void (*UniffiForeignFutureCompletePointer)(uint64_t, UniffiForeignFutureStructPointer
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructRustBuffer {
RustBuffer returnValue;
RustCallStatus callStatus;
} UniffiForeignFutureStructRustBuffer;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER
typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureStructRustBuffer
);
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID
typedef #d73a49; font-weight: bold;\">struct UniffiForeignFutureStructVoid {
RustCallStatus callStatus;
} UniffiForeignFutureStructVoid;
#endif
#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID
#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID
typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_FN_FUNC_RUST_ADD
#define UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_FN_FUNC_RUST_ADD
uint32_t uniffi_rustylib_fn_func_rust_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_FN_FUNC_RUST_HELLO
#define UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_FN_FUNC_RUST_HELLO
RustBuffer uniffi_rustylib_fn_func_rust_hello(RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_ALLOC
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_ALLOC
RustBuffer ffi_rustylib_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_FROM_BYTES
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_FROM_BYTES
RustBuffer ffi_rustylib_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_FREE
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_FREE
void ffi_rustylib_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_RESERVE
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUSTBUFFER_RESERVE
RustBuffer ffi_rustylib_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U8
void ffi_rustylib_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U8
void ffi_rustylib_rust_future_cancel_u8(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U8
void ffi_rustylib_rust_future_free_u8(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U8
uint8_t ffi_rustylib_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I8
void ffi_rustylib_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I8
void ffi_rustylib_rust_future_cancel_i8(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I8
void ffi_rustylib_rust_future_free_i8(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I8
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I8
int8_t ffi_rustylib_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U16
void ffi_rustylib_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U16
void ffi_rustylib_rust_future_cancel_u16(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U16
void ffi_rustylib_rust_future_free_u16(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U16
uint16_t ffi_rustylib_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I16
void ffi_rustylib_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I16
void ffi_rustylib_rust_future_cancel_i16(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I16
void ffi_rustylib_rust_future_free_i16(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I16
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I16
int16_t ffi_rustylib_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U32
void ffi_rustylib_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U32
void ffi_rustylib_rust_future_cancel_u32(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U32
void ffi_rustylib_rust_future_free_u32(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U32
uint32_t ffi_rustylib_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I32
void ffi_rustylib_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I32
void ffi_rustylib_rust_future_cancel_i32(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I32
void ffi_rustylib_rust_future_free_i32(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I32
int32_t ffi_rustylib_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_U64
void ffi_rustylib_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_U64
void ffi_rustylib_rust_future_cancel_u64(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_U64
void ffi_rustylib_rust_future_free_u64(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_U64
uint64_t ffi_rustylib_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_I64
void ffi_rustylib_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_I64
void ffi_rustylib_rust_future_cancel_i64(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_I64
void ffi_rustylib_rust_future_free_i64(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_I64
int64_t ffi_rustylib_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_F32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_F32
void ffi_rustylib_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_F32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_F32
void ffi_rustylib_rust_future_cancel_f32(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_F32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_F32
void ffi_rustylib_rust_future_free_f32(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_F32
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_F32
float ffi_rustylib_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_F64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_F64
void ffi_rustylib_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_F64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_F64
void ffi_rustylib_rust_future_cancel_f64(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_F64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_F64
void ffi_rustylib_rust_future_free_f64(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_F64
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_F64
double ffi_rustylib_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_POINTER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_POINTER
void ffi_rustylib_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_POINTER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_POINTER
void ffi_rustylib_rust_future_cancel_pointer(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_POINTER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_POINTER
void ffi_rustylib_rust_future_free_pointer(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_POINTER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_POINTER
void*_Nonnull ffi_rustylib_rust_future_complete_pointer(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_RUST_BUFFER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_RUST_BUFFER
void ffi_rustylib_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_RUST_BUFFER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_RUST_BUFFER
void ffi_rustylib_rust_future_cancel_rust_buffer(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_RUST_BUFFER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_RUST_BUFFER
void ffi_rustylib_rust_future_free_rust_buffer(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_RUST_BUFFER
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_RUST_BUFFER
RustBuffer ffi_rustylib_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_VOID
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_POLL_VOID
void ffi_rustylib_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_VOID
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_CANCEL_VOID
void ffi_rustylib_rust_future_cancel_void(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_VOID
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_FREE_VOID
void ffi_rustylib_rust_future_free_void(uint64_t handle
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_VOID
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_RUST_FUTURE_COMPLETE_VOID
void ffi_rustylib_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_CHECKSUM_FUNC_RUST_ADD
#define UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_CHECKSUM_FUNC_RUST_ADD
uint16_t uniffi_rustylib_checksum_func_rust_add(void
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_CHECKSUM_FUNC_RUST_HELLO
#define UNIFFI_FFIDEF_UNIFFI_RUSTYLIB_CHECKSUM_FUNC_RUST_HELLO
uint16_t uniffi_rustylib_checksum_func_rust_hello(void
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_RUSTYLIB_UNIFFI_CONTRACT_VERSION
#define UNIFFI_FFIDEF_FFI_RUSTYLIB_UNIFFI_CONTRACT_VERSION
uint32_t ffi_rustylib_uniffi_contract_version(void
);
#endif
rustylib/src/rustylibFFI.modulemap
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!
module rustylibFFI {
header #032f62;\">"rustylibFFI.h"
#d73a49; font-weight: bold;\">export *
}rustylib/uniffi-bindgen.rs
#d73a49; font-weight: bold;\">fn main() {
uniffi::uniffi_bindgen_main()
}swiftyapp/Lib/swiftyrustlib/Package.swift
// swift-tools-version:5.10
#d73a49; font-weight: bold;\">import PackageDescription
#d73a49; font-weight: bold;\">let package = Package(
name: #032f62;\">"RustyLib",
platforms: [
.iOS(.v15),
.macCatalyst(.v15)
],
products: [
.library(
name: #032f62;\">"RustyLib",
targets: [#032f62;\">"RustyLib"])
],
dependencies: [
],
targets: [
.target(
name: #032f62;\">"RustyLib",
dependencies: [
.byName(name: #032f62;\">"RustyCore")
],
path: #032f62;\">"Sources/"
),
.binaryTarget(
name: #032f62;\">"RustyCore",
path: #032f62;\">"artifacts/RustyCore.xcframework"
),
]
)
swiftyapp/Lib/swiftyrustlib/Sources/RustyLib/RustyLib.swift
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!
// swiftlint:disable all
#d73a49; font-weight: bold;\">import Foundation
// Depending on the consumer's build setup, the low-level FFI code
// might be in a separate module, or it might be compiled inline into
// this module. This is a bit of light hackery to work with both.
#if canImport(rustylibFFI)
#d73a49; font-weight: bold;\">import rustylibFFI
#endif
private extension RustBuffer {
/// Allocate a new buffer, copying the contents of a `UInt8` array.
init(bytes: [UInt8]) {
#d73a49; font-weight: bold;\">let rbuf = bytes.withUnsafeBufferPointer { ptr in
RustBuffer.from(ptr)
}
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}
static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len: 0, data: nil)
}
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_rustylib_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
/// Frees the buffer in place.
/// The buffer must not be used after this is called.
func deallocate() {
try! rustCall { ffi_rustylib_rustbuffer_free(self, $0) }
}
}
private extension ForeignBytes {
init(bufferPointer: UnsafeBufferPointer<UInt8>) {
self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress)
}
}
// For every type used in the interface, we provide helper methods for conveniently
// lifting and lowering that type from C-compatible data, and for reading and writing
// values of that type in a buffer.
// Helper classes/extensions that don't change.
// Someday, this will be in a library of its own.
private extension Data {
init(rustBuffer: RustBuffer) {
// TODO: This copies the buffer. Can we read directly from a
// Rust buffer?
self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len))
}
}
// Define reader functionality. Normally this would be defined in a class or
// struct, but we use standalone functions instead in order to make external
// types work.
//
// With external types, one swift source file needs to be able to call the read
// method on another source file's FfiConverter, but then what visibility
// should Reader have?
// - If Reader is fileprivate, then this means the read() must also
// be fileprivate, which doesn't work with external types.
// - If Reader is internal/public, we'll get compile errors since both source
// files will try define the same type.
//
// Instead, the read() method and these helper functions input a tuple of data
private func createReader(data: Data) -> (data: Data, offset: Data.Index) {
(data: data, offset: 0)
}
/// Reads an integer at the current offset, in big-endian order, and advances
/// the offset on success. Throws if reading the integer would move the
/// offset past the end of the buffer.
private func readInt<T: FixedWidthInteger>(_ reader: inout (data: Data, offset: Data.Index)) throws -> T {
#d73a49; font-weight: bold;\">let range = reader.offset ..< reader.offset + MemoryLayout<T>.size
guard reader.data.count >= range.upperBound #d73a49; font-weight: bold;\">else {
throw UniffiInternalError.bufferOverflow
}
#d73a49; font-weight: bold;\">if T.self == UInt8.self {
#d73a49; font-weight: bold;\">let value = reader.data[reader.offset]
reader.offset += 1
#d73a49; font-weight: bold;\">return value as! T
}
#d73a49; font-weight: bold;\">var value: T = 0
#d73a49; font-weight: bold;\">let _ = withUnsafeMutableBytes(of: &value) { reader.data.copyBytes(to: $0, from: range) }
reader.offset = range.upperBound
#d73a49; font-weight: bold;\">return value.bigEndian
}
/// Reads an arbitrary number of bytes, to be used to read
/// raw bytes, this is useful when lifting strings
private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> [UInt8] {
#d73a49; font-weight: bold;\">let range = reader.offset ..< (reader.offset + count)
guard reader.data.count >= range.upperBound #d73a49; font-weight: bold;\">else {
throw UniffiInternalError.bufferOverflow
}
#d73a49; font-weight: bold;\">var value = [UInt8](repeating: 0, count: count)
value.withUnsafeMutableBufferPointer { buffer in
reader.data.copyBytes(to: buffer, from: range)
}
reader.offset = range.upperBound
#d73a49; font-weight: bold;\">return value
}
/// Reads a float at the current offset.
private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float {
#d73a49; font-weight: bold;\">return try Float(bitPattern: readInt(&reader))
}
/// Reads a float at the current offset.
private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double {
#d73a49; font-weight: bold;\">return try Double(bitPattern: readInt(&reader))
}
/// Indicates if the offset has reached the end of the buffer.
private func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool {
#d73a49; font-weight: bold;\">return reader.offset < reader.data.count
}
// Define writer functionality. Normally this would be defined in a class or
// struct, but we use standalone functions instead in order to make external
// types work. See the above discussion on Readers for details.
private func createWriter() -> [UInt8] {
#d73a49; font-weight: bold;\">return []
}
private func writeBytes<S: Sequence>(_ writer: inout [UInt8], _ byteArr: S) where S.Element == UInt8 {
writer.append(contentsOf: byteArr)
}
/// Writes an integer in big-endian order.
///
/// Warning: make sure what you are trying to write
/// is in the correct type!
private func writeInt<T: FixedWidthInteger>(_ writer: inout [UInt8], _ value: T) {
#d73a49; font-weight: bold;\">var value = value.bigEndian
withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) }
}
private func writeFloat(_ writer: inout [UInt8], _ value: Float) {
writeInt(&writer, value.bitPattern)
}
private func writeDouble(_ writer: inout [UInt8], _ value: Double) {
writeInt(&writer, value.bitPattern)
}
/// Protocol for types that transfer other types across the FFI. This is
/// analogous to the Rust trait of the same name.
private protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
static func lift(_ value: FfiType) throws -> SwiftType
static func lower(_ value: SwiftType) -> FfiType
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType
static func write(_ value: SwiftType, into buf: inout [UInt8])
}
/// Types conforming to `Primitive` pass themselves directly over the FFI.
private protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType {}
extension FfiConverterPrimitive {
public static func lift(_ value: FfiType) throws -> SwiftType {
#d73a49; font-weight: bold;\">return value
}
public static func lower(_ value: SwiftType) -> FfiType {
#d73a49; font-weight: bold;\">return value
}
}
/// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`.
/// Used for complex types where it's hard to write a custom lift/lower.
private protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {}
extension FfiConverterRustBuffer {
public static func lift(_ buf: RustBuffer) throws -> SwiftType {
#d73a49; font-weight: bold;\">var reader = createReader(data: Data(rustBuffer: buf))
#d73a49; font-weight: bold;\">let value = try read(from: &reader)
#d73a49; font-weight: bold;\">if hasRemaining(reader) {
throw UniffiInternalError.incompleteData
}
buf.deallocate()
#d73a49; font-weight: bold;\">return value
}
public static func lower(_ value: SwiftType) -> RustBuffer {
#d73a49; font-weight: bold;\">var writer = createWriter()
write(value, into: &writer)
#d73a49; font-weight: bold;\">return RustBuffer(bytes: writer)
}
}
/// An error type for FFI errors. These errors occur at the UniFFI level, not
/// the library level.
private enum UniffiInternalError: LocalizedError {
case bufferOverflow
case incompleteData
case unexpectedOptionalTag
case unexpectedEnumCase
case unexpectedNullPointer
case unexpectedRustCallStatusCode
case unexpectedRustCallError
case unexpectedStaleHandle
case rustPanic(_ message: String)
#d73a49; font-weight: bold;\">var errorDescription: String? {
switch self {
case .bufferOverflow: #d73a49; font-weight: bold;\">return "Reading the requested value would read past the end of the buffer"
case .incompleteData: #d73a49; font-weight: bold;\">return "The buffer still has data after lifting its containing value"
case .unexpectedOptionalTag: #d73a49; font-weight: bold;\">return "Unexpected optional tag; should be 0 or 1"
case .unexpectedEnumCase: #d73a49; font-weight: bold;\">return "Raw enum value doesn't match any cases"
case .unexpectedNullPointer: #d73a49; font-weight: bold;\">return "Raw pointer value was null"
case .unexpectedRustCallStatusCode: #d73a49; font-weight: bold;\">return "Unexpected RustCallStatus code"
case .unexpectedRustCallError: #d73a49; font-weight: bold;\">return "CALL_ERROR but no errorClass specified"
case .unexpectedStaleHandle: #d73a49; font-weight: bold;\">return "The object in the handle map has been dropped already"
case #d73a49; font-weight: bold;\">let .rustPanic(message): return message
}
}
}
private extension NSLock {
func withLock<T>(f: () throws -> T) rethrows -> T {
lock()
defer { self.unlock() }
#d73a49; font-weight: bold;\">return try f()
}
}
private #d73a49; font-weight: bold;\">let CALL_SUCCESS: Int8 = 0
private #d73a49; font-weight: bold;\">let CALL_ERROR: Int8 = 1
private #d73a49; font-weight: bold;\">let CALL_UNEXPECTED_ERROR: Int8 = 2
private #d73a49; font-weight: bold;\">let CALL_CANCELLED: Int8 = 3
private extension RustCallStatus {
init() {
self.init(
code: CALL_SUCCESS,
errorBuf: RustBuffer(
capacity: 0,
len: 0,
data: nil
)
)
}
}
private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
#d73a49; font-weight: bold;\">let neverThrow: ((RustBuffer) throws -> Never)? = nil
#d73a49; font-weight: bold;\">return try makeRustCall(callback, errorHandler: neverThrow)
}
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T
) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
#d73a49; font-weight: bold;\">var callStatus = RustCallStatus()
#d73a49; font-weight: bold;\">let returnedVal = callback(&callStatus)
try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler)
#d73a49; font-weight: bold;\">return returnedVal
}
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
#d73a49; font-weight: bold;\">return
case CALL_ERROR:
#d73a49; font-weight: bold;\">if let errorHandler = errorHandler {
throw try errorHandler(callStatus.errorBuf)
} #d73a49; font-weight: bold;\">else {
callStatus.errorBuf.deallocate()
throw UniffiInternalError.unexpectedRustCallError
}
case CALL_UNEXPECTED_ERROR:
// When the rust code sees a panic, it tries to construct a RustBuffer
// with the message. But if that code panics, then it just sends back
// an empty buffer.
#d73a49; font-weight: bold;\">if callStatus.errorBuf.len > 0 {
throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf))
} #d73a49; font-weight: bold;\">else {
callStatus.errorBuf.deallocate()
throw UniffiInternalError.rustPanic(#032f62;\">"Rust panic")
}
case CALL_CANCELLED:
fatalError(#032f62;\">"Cancellation not supported yet")
default:
throw UniffiInternalError.unexpectedRustCallStatusCode
}
}
private func uniffiTraitInterfaceCall<T>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> Void
) {
do {
try writeReturn(makeCall())
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
private func uniffiTraitInterfaceCallWithError<T, E>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> Void,
lowerError: (E) -> RustBuffer
) {
do {
try writeReturn(makeCall())
} catch #d73a49; font-weight: bold;\">let error as E {
callStatus.pointee.code = CALL_ERROR
callStatus.pointee.errorBuf = lowerError(error)
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
private #d73a49; font-weight: bold;\">class UniffiHandleMap<T> {
private #d73a49; font-weight: bold;\">var map: [UInt64: T] = [:]
private #d73a49; font-weight: bold;\">let lock = NSLock()
private #d73a49; font-weight: bold;\">var currentHandle: UInt64 = 1
func insert(obj: T) -> UInt64 {
lock.withLock {
#d73a49; font-weight: bold;\">let handle = currentHandle
currentHandle += 1
map[handle] = obj
#d73a49; font-weight: bold;\">return handle
}
}
func get(handle: UInt64) throws -> T {
try lock.withLock {
guard #d73a49; font-weight: bold;\">let obj = map[handle] else {
throw UniffiInternalError.unexpectedStaleHandle
}
#d73a49; font-weight: bold;\">return obj
}
}
@discardableResult
func remove(handle: UInt64) throws -> T {
try lock.withLock {
guard #d73a49; font-weight: bold;\">let obj = map.removeValue(forKey: handle) else {
throw UniffiInternalError.unexpectedStaleHandle
}
#d73a49; font-weight: bold;\">return obj
}
}
#d73a49; font-weight: bold;\">var count: Int {
map.count
}
}
// Public interface members begin here.
private #d73a49; font-weight: bold;\">struct FfiConverterUInt32: FfiConverterPrimitive {
typealias FfiType = UInt32
typealias SwiftType = UInt32
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 {
#d73a49; font-weight: bold;\">return try lift(readInt(&buf))
}
static func write(_ value: SwiftType, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
private #d73a49; font-weight: bold;\">struct FfiConverterString: FfiConverter {
typealias SwiftType = String
typealias FfiType = RustBuffer
static func lift(_ value: RustBuffer) throws -> String {
defer {
value.deallocate()
}
#d73a49; font-weight: bold;\">if value.data == nil {
#d73a49; font-weight: bold;\">return String()
}
#d73a49; font-weight: bold;\">let bytes = UnsafeBufferPointer<UInt8>(start: value.data!, count: Int(value.len))
#d73a49; font-weight: bold;\">return String(bytes: bytes, encoding: String.Encoding.utf8)!
}
static func lower(_ value: String) -> RustBuffer {
#d73a49; font-weight: bold;\">return value.utf8CString.withUnsafeBufferPointer { ptr in
// The swift string gives us int8_t, we want uint8_t.
ptr.withMemoryRebound(to: UInt8.self) { ptr in
// The swift string gives us a trailing null byte, we don't want it.
#d73a49; font-weight: bold;\">let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1))
#d73a49; font-weight: bold;\">return RustBuffer.from(buf)
}
}
}
static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String {
#d73a49; font-weight: bold;\">let len: Int32 = try readInt(&buf)
#d73a49; font-weight: bold;\">return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)!
}
static func write(_ value: String, into buf: inout [UInt8]) {
#d73a49; font-weight: bold;\">let len = Int32(value.utf8.count)
writeInt(&buf, len)
writeBytes(&buf, value.utf8)
}
}
public func rustAdd(a: UInt32, b: UInt32) -> UInt32 {
#d73a49; font-weight: bold;\">return try! FfiConverterUInt32.lift(try! rustCall {
uniffi_rustylib_fn_func_rust_add(
FfiConverterUInt32.lower(a),
FfiConverterUInt32.lower(b), $0
)
})
}
public func rustHello() -> String {
#d73a49; font-weight: bold;\">return try! FfiConverterString.lift(try! rustCall {
uniffi_rustylib_fn_func_rust_hello($0)
})
}
private enum InitializationResult {
case ok
case contractVersionMismatch
case apiChecksumMismatch
}
/// Use a global variable to perform the versioning checks. Swift ensures that
/// the code inside is only computed once.
private #d73a49; font-weight: bold;\">var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
#d73a49; font-weight: bold;\">let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
#d73a49; font-weight: bold;\">let scaffolding_contract_version = ffi_rustylib_uniffi_contract_version()
#d73a49; font-weight: bold;\">if bindings_contract_version != scaffolding_contract_version {
#d73a49; font-weight: bold;\">return InitializationResult.contractVersionMismatch
}
#d73a49; font-weight: bold;\">if uniffi_rustylib_checksum_func_rust_add() != 47653 {
#d73a49; font-weight: bold;\">return InitializationResult.apiChecksumMismatch
}
#d73a49; font-weight: bold;\">if uniffi_rustylib_checksum_func_rust_hello() != 11814 {
#d73a49; font-weight: bold;\">return InitializationResult.apiChecksumMismatch
}
#d73a49; font-weight: bold;\">return InitializationResult.ok
}()
private func uniffiEnsureInitialized() {
switch initializationResult {
case .ok:
break
case .contractVersionMismatch:
fatalError(#032f62;\">"UniFFI contract version mismatch: try cleaning and rebuilding your project")
case .apiChecksumMismatch:
fatalError(#032f62;\">"UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
}
// swiftlint:enable all
swiftyapp/swiftyapp/Assets.xcassets/AccentColor.colorset/Contents.json
{
#032f62;\">"colors" : [
{
#032f62;\">"idiom" : "universal"
}
],
#032f62;\">"info" : {
#032f62;\">"author" : "xcode",
#032f62;\">"version" : 1
}
}
swiftyapp/swiftyapp/Assets.xcassets/AppIcon.appiconset/Contents.json
{
#032f62;\">"images" : [
{
#032f62;\">"idiom" : "universal",
#032f62;\">"platform" : "ios",
#032f62;\">"size" : "1024x1024"
}
],
#032f62;\">"info" : {
#032f62;\">"author" : "xcode",
#032f62;\">"version" : 1
}
}
swiftyapp/swiftyapp/Assets.xcassets/Contents.json
{
#032f62;\">"info" : {
#032f62;\">"author" : "xcode",
#032f62;\">"version" : 1
}
}
swiftyapp/swiftyapp/ContentView.swift
//
// ContentView.swift
// swiftyapp
//
// Created by Jonathan McKenzie on 7/9/24.
//
#d73a49; font-weight: bold;\">import SwiftUI
#d73a49; font-weight: bold;\">import RustyLib
#d73a49; font-weight: bold;\">struct ContentView: View {
#d73a49; font-weight: bold;\">var body: some View {
print(#032f62;\">"ContentView: body property accessed.")
#d73a49; font-weight: bold;\">let helloMessage = rustHello()
#d73a49; font-weight: bold;\">let sum = rustAdd(a: 10, b: 32)
print(#032f62;\">"ContentView: rustHello() returned \(helloMessage)")
print(#032f62;\">"ContentView: rustAdd(a: 10, b: 32) returned \(sum)")
#d73a49; font-weight: bold;\">return VStack {
Image(systemName: #032f62;\">"globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text(helloMessage)
Text(String(sum))
}
.padding()
}
}
#Preview {
ContentView()
}
swiftyapp/swiftyapp/Preview Content/Preview Assets.xcassets/Contents.json
{
#032f62;\">"info" : {
#032f62;\">"author" : "xcode",
#032f62;\">"version" : 1
}
}
swiftyapp/swiftyapp/swiftyappApp.swift
//
// swiftyappApp.swift
// swiftyapp
//
// Created by Jonathan McKenzie on 7/9/24.
//
#d73a49; font-weight: bold;\">import SwiftUI
@main
#d73a49; font-weight: bold;\">struct swiftyappApp: App {
#d73a49; font-weight: bold;\">var body: some Scene {
print(#032f62;\">"swiftyappApp: body property accessed.")
#d73a49; font-weight: bold;\">return WindowGroup {
ContentView()
}
}
}
swiftyapp/swiftyapp.xcodeproj/project.pbxproj
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */
291DE5342C3DE74F007F9706 /* swiftyappApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291DE5332C3DE74F007F9706 /* swiftyappApp.swift */; };
291DE5362C3DE74F007F9706 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291DE5352C3DE74F007F9706 /* ContentView.swift */; };
291DE5382C3DE74F007F9706 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 291DE5372C3DE74F007F9706 /* Assets.xcassets */; };
291DE53B2C3DE74F007F9706 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 291DE53A2C3DE74F007F9706 /* Preview Assets.xcassets */; };
2986A2E32C3F8FA200D13583 /* RustyLib in Frameworks */ = {isa = PBXBuildFile; productRef = 2986A2E22C3F8FA200D13583 /* RustyLib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
291DE5592C3DF1CA007F9706 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = #032f62;\">"";
dstSubfolderSpec = 10;
files = (
);
name = #032f62;\">"Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
29B7A0012DF6E10000A1B2C3 /* Build RustyLib */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
name = #032f62;\">"Build RustyLib";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = #032f62;\">"set -euo pipefail\ncd \"${SRCROOT}/..\"\n./build.sh\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXFileReference section */
291DE5302C3DE74F007F9706 /* swiftyapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = swiftyapp.app; sourceTree = BUILT_PRODUCTS_DIR; };
291DE5332C3DE74F007F9706 /* swiftyappApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = swiftyappApp.swift; sourceTree = #032f62;\">"<group>"; };
291DE5352C3DE74F007F9706 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = #032f62;\">"<group>"; };
291DE5372C3DE74F007F9706 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = #032f62;\">"<group>"; };
291DE53A2C3DE74F007F9706 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = #032f62;\">"Preview Assets.xcassets"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
291DE52D2C3DE74F007F9706 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2986A2E32C3F8FA200D13583 /* RustyLib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
291DE5272C3DE74F007F9706 = {
isa = PBXGroup;
children = (
29603C272C3F8BB900B29635 /* Lib */,
291DE5322C3DE74F007F9706 /* swiftyapp */,
291DE5312C3DE74F007F9706 /* Products */,
291DE5412C3DE809007F9706 /* Frameworks */,
);
sourceTree = #032f62;\">"<group>";
};
291DE5312C3DE74F007F9706 /* Products */ = {
isa = PBXGroup;
children = (
291DE5302C3DE74F007F9706 /* swiftyapp.app */,
);
name = Products;
sourceTree = #032f62;\">"<group>";
};
291DE5322C3DE74F007F9706 /* swiftyapp */ = {
isa = PBXGroup;
children = (
291DE5332C3DE74F007F9706 /* swiftyappApp.swift */,
291DE5352C3DE74F007F9706 /* ContentView.swift */,
291DE5372C3DE74F007F9706 /* Assets.xcassets */,
291DE5392C3DE74F007F9706 /* Preview Content */,
);
path = swiftyapp;
sourceTree = #032f62;\">"<group>";
};
291DE5392C3DE74F007F9706 /* Preview Content */ = {
isa = PBXGroup;
children = (
291DE53A2C3DE74F007F9706 /* Preview Assets.xcassets */,
);
path = #032f62;\">"Preview Content";
sourceTree = #032f62;\">"<group>";
};
291DE5412C3DE809007F9706 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = #032f62;\">"<group>";
};
29603C272C3F8BB900B29635 /* Lib */ = {
isa = PBXGroup;
children = (
);
path = Lib;
sourceTree = #032f62;\">"<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
291DE52F2C3DE74F007F9706 /* swiftyapp */ = {
isa = PBXNativeTarget;
buildConfigurationList = 291DE53E2C3DE74F007F9706 /* Build configuration list #d73a49; font-weight: bold;\">for PBXNativeTarget "swiftyapp" */;
buildPhases = (
29B7A0012DF6E10000A1B2C3 /* Build RustyLib */,
291DE52C2C3DE74F007F9706 /* Sources */,
291DE52D2C3DE74F007F9706 /* Frameworks */,
291DE52E2C3DE74F007F9706 /* Resources */,
291DE5592C3DF1CA007F9706 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = swiftyapp;
packageProductDependencies = (
2986A2E22C3F8FA200D13583 /* RustyLib */,
);
productName = swiftyapp;
productReference = 291DE5302C3DE74F007F9706 /* swiftyapp.app */;
productType = #032f62;\">"com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
291DE5282C3DE74F007F9706 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 1530;
TargetAttributes = {
291DE52F2C3DE74F007F9706 = {
CreatedOnToolsVersion = 15.3;
};
};
};
buildConfigurationList = 291DE52B2C3DE74F007F9706 /* Build configuration list #d73a49; font-weight: bold;\">for PBXProject "swiftyapp" */;
compatibilityVersion = #032f62;\">"Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 291DE5272C3DE74F007F9706;
packageReferences = (
2986A2DF2C3F8F9800D13583 /* XCLocalSwiftPackageReference #032f62;\">"Lib/swiftyrustlib" */,
);
productRefGroup = 291DE5312C3DE74F007F9706 /* Products */;
projectDirPath = #032f62;\">"";
projectRoot = #032f62;\">"";
targets = (
291DE52F2C3DE74F007F9706 /* swiftyapp */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
291DE52E2C3DE74F007F9706 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
291DE53B2C3DE74F007F9706 /* Preview Assets.xcassets in Resources */,
291DE5382C3DE74F007F9706 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
291DE52C2C3DE74F007F9706 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
291DE5362C3DE74F007F9706 /* ContentView.swift in Sources */,
291DE5342C3DE74F007F9706 /* swiftyappApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
291DE53C2C3DE74F007F9706 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = #032f62;\">"gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
#032f62;\">"DEBUG=1",
#032f62;\">"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = #032f62;\">"DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = #032f62;\">"-Onone";
};
name = Debug;
};
291DE53D2C3DE74F007F9706 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = #032f62;\">"gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = #032f62;\">"dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
291DE53F2C3DE74F007F9706 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = #032f62;\">"Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = #032f62;\">"\"swiftyapp/Preview Content\"";
DEVELOPMENT_TEAM = M684FYCYG6;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = #032f62;\">"UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = #032f62;\">"UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
#032f62;\">"$(inherited)",
#032f62;\">"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.gnostr.swiftyapp;
PRODUCT_NAME = #032f62;\">"$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = #032f62;\">"";
SUPPORTED_PLATFORMS = #032f62;\">"appletvos appletvsimulator driverkit iphoneos iphonesimulator watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = #032f62;\">"1,2";
};
name = Debug;
};
291DE5402C3DE74F007F9706 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = #032f62;\">"Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = #032f62;\">"\"swiftyapp/Preview Content\"";
DEVELOPMENT_TEAM = M684FYCYG6;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = #032f62;\">"UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = #032f62;\">"UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
#032f62;\">"$(inherited)",
#032f62;\">"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = org.gnostr.swiftyapp;
PRODUCT_NAME = #032f62;\">"$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = #032f62;\">"";
SUPPORTED_PLATFORMS = #032f62;\">"appletvos appletvsimulator driverkit iphoneos iphonesimulator watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = #032f62;\">"1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
291DE52B2C3DE74F007F9706 /* Build configuration list #d73a49; font-weight: bold;\">for PBXProject "swiftyapp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
291DE53C2C3DE74F007F9706 /* Debug */,
291DE53D2C3DE74F007F9706 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
291DE53E2C3DE74F007F9706 /* Build configuration list #d73a49; font-weight: bold;\">for PBXNativeTarget "swiftyapp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
291DE53F2C3DE74F007F9706 /* Debug */,
291DE5402C3DE74F007F9706 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
2986A2DF2C3F8F9800D13583 /* XCLocalSwiftPackageReference #032f62;\">"Lib/swiftyrustlib" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Lib/swiftyrustlib;
};
/* End XCLocalSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
2986A2E22C3F8FA200D13583 /* RustyLib */ = {
isa = XCSwiftPackageProductDependency;
package = 2986A2DF2C3F8F9800D13583 /* XCLocalSwiftPackageReference #032f62;\">"Lib/swiftyrustlib" */;
productName = RustyLib;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 291DE5282C3DE74F007F9706 /* Project object */;
}
swiftyapp/swiftyapp.xcodeproj/project.xcworkspace/contents.xcworkspacedata
<?xml version=#032f62;\">"1.0" encoding="UTF-8"?>
<Workspace
version = #032f62;\">"1.0">
<FileRef
location = #032f62;\">"self:">
</FileRef>
</Workspace>
swiftyapp/swiftyapp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
<?xml version=#032f62;\">"1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC #032f62;\">"-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version=#032f62;\">"1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>