rust-mac-app-examples

Examples of and templates for running Rust in Cocoa apps on the Mac

  • 所有者: kattrali/rust-mac-app-examples
  • 平台:
  • 许可证: BSD 2-Clause "Simplified" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Using Rust in Cocoa apps

Examples for working with the Objective-C runtime from Rust, with a companion
blog post about the
rationale behind the setup.

Each example is annotated and can be run using cargo run or using the
specialized instructions below, if any.

Examples

  1. Creating Objective-C objects from Rust:
    Creates an object and sends it a message

  2. Displaying a Cocoa Window:
    Creates and presents a Cocoa app with a single window, leveraging the cocoa
    crate

  3. Packaging a macOS app:
    Compiles and runs a Rust binary as a part of a macOS app. The Rust binary is
    launched as the primary process and handles presenting the user interface.
    Run the application by opening the Xcode project in the app/ directory of
    the example and using the Run button.

  4. Wrapping Cocoa APIs:
    Creates a custom interface in Rust to accessing Cocoa classes (somewhat)
    safely, or at least without unsafe blocks

  5. Declaring a new Objective-C class from Rust:
    Creates and registers an Objective-C class with the runtime from Rust, as
    well as sending messages to an instance from both Rust and Objective-C

  6. Include a Rust library in a Cocoa app:
    Create a static library in Rust, and bundles/links it with a mac app. The mac
    app target in Xcode depends on an external target which is the Rust library,
    and the C header for the Rust library is used to invoke Rust functions from
    Swift. Run the application by opening the Xcode project and using the Run
    button.

主要指标

概览
名称与所有者kattrali/rust-mac-app-examples
主编程语言Rust
编程语言Rust (语言数: 4)
平台
许可证BSD 2-Clause "Simplified" License
所有者活动
创建于2016-11-17 22:51:22
推送于2021-04-10 18:56:59
最后一次提交2018-08-07 09:55:07
发布数0
用户参与
星数263
关注者数6
派生数19
提交数3
已启用问题?
问题数3
打开的问题数3
拉请求数1
打开的拉请求数1
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?