[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5756":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":18,"lastSyncTime":36,"discoverSource":37},5756,"rustler","rusterlium\u002Frustler","rusterlium","Safe Rust bridge for creating Erlang NIF functions","https:\u002F\u002Fdocs.rs\u002Fcrate\u002Frustler",null,"Rust",4805,243,73,35,0,1,2,21,4,29.16,"Apache License 2.0",false,"master",true,[27,28,29,30,31,32],"binding","elixir","erlang","ffi","nif","rust","2026-06-12 02:01:14","# Rustler\n\n[Documentation](https:\u002F\u002Fdocs.rs\u002Frustler\u002Flatest\u002Frustler) | [Getting Started](https:\u002F\u002Fgithub.com\u002Frusterlium\u002Frustler\u002Fblob\u002Fmaster\u002FREADME.md#getting-started) | [Example](https:\u002F\u002Fgithub.com\u002Frusterlium\u002FNifIo)\n\n[![GitHub Actions Workflow Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Frusterlium\u002Frustler\u002Fmain.yml)](https:\u002F\u002Fgithub.com\u002Frusterlium\u002Frustler\u002Factions\u002Fworkflows\u002Fmain.yml)\n[![Hex.pm package version](https:\u002F\u002Fimg.shields.io\u002Fhexpm\u002Fv\u002Frustler.svg)](https:\u002F\u002Fhex.pm\u002Fpackages\u002Frustler)\n[![Crates.io package version](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Frustler.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Frustler)\n[![Last Updated](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flast-commit\u002Frusterlium\u002Frustler.svg)](https:\u002F\u002Fgithub.com\u002Frusterlium\u002Frustler\u002Fcommits\u002Fmaster)\n\nRustler is a library for writing Erlang NIFs in safe Rust code. That means\nthere should be no ways to crash the BEAM (Erlang VM). The library provides\nfacilities for generating the boilerplate for interacting with the BEAM,\nhandles encoding and decoding of Erlang terms, and catches rust panics before\nthey unwind into C.\n\nThe library provides functionality for both Erlang and Elixir, however Elixir\nis favored as of now.\n\n#### Features\n\n**Safety**  \nThe code you write in a Rust NIF should never be able to crash the BEAM.\n\n**Interop**  \nDecoding and encoding rust values into Erlang terms is as easy as a function call.\n\n**Type composition**  \nMaking a Rust struct encodable and decodable to Erlang or Elixir can be done with a single attribute.\n\n**Resource objects**  \nEnables you to safely pass a reference to a Rust struct into Erlang code. The struct will be automatically dropped when it's no longer referenced.\n\n#### Getting started\n\nThe easiest way of getting started is the [rustler Elixir library](https:\u002F\u002Fhex.pm\u002Fpackages\u002Frustler).\n\n- Add the [rustler Elixir library](https:\u002F\u002Fhex.pm\u002Fpackages\u002Frustler) as a\n  dependency of your project.\n- Run `mix rustler.new` to generate a new NIF in your project. Follow the\n  instructions.\n- If you are already using [`serde`](https:\u002F\u002Fserde.rs) and\u002For have been using\n  `serde_rustler` before, please enable the `serde` feature in your NIF crate's\n  `Cargo.toml` on the `rustler` dependency.\n\n#### What it looks like\n\nThis is the code for a minimal NIF that adds two numbers and returns the result.\n\n```rust\n#[rustler::nif]\nfn add(a: i64, b: i64) -> i64 {\n    a + b\n}\n\nrustler::init!(\"Elixir.Math\");\n```\n\n#### Minimal Supported Rust Version (MSRV)\n\nRustler currently has a minimal supported Rust version (MSRV) of 1.91. This\nis the configured version in `.clippy.toml`.\n\n#### Supported OTP and Elixir Versions\n\nRustler aims to support the newest three major OTP versions as well as newest three minor Elixir versions.\n\n#### Supported NIF version\n\nThe minimal supported NIF version for a library should be defined via Cargo\nfeatures. The default is currently `2.15` (Erlang\u002FOTP 22). To use features from\nNIF version `2.16` (Erlang\u002FOTP 24) or `2.17` (Erlang\u002FOTP 26), the respective\nfeature flag has to be enabled on the dependency:\n\n```toml\n[dependencies]\nrustler = { version = \"...\", features = [\"nif_version_2_16\"] }\n```\n\n#### Community\n\nYou can find us in the `#rustler:matrix.org` channel on [Matrix](https:\u002F\u002Fmatrix.to\u002F#\u002F#rustler:matrix.org)\nor in the `#rustler` channel in [the Elixir lang Slack](https:\u002F\u002Felixir-slackin.herokuapp.com\u002F).\n\n#### License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n\nat your option.\n\n##### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","Rustler 是一个用于使用安全的 Rust 代码编写 Erlang NIF（Native Implemented Functions）的库。它通过提供与 BEAM（Erlang 虚拟机）交互所需的模板代码、处理 Erlang 术语的编码和解码以及捕获 Rust panic 来确保不会导致 BEAM 崩溃，从而保证了安全性。Rustler 支持 Erlang 和 Elixir 的互操作性，但目前更偏向于 Elixir。其主要特性包括：类型组合简化了 Rust 结构体与 Erlang 或 Elixir 之间的转换；资源对象允许在 Erlang 代码中安全地引用 Rust 结构体，并在不再被引用时自动释放。适用于需要高性能计算且对稳定性有高要求的场景，如金融交易系统或实时数据分析平台。","2026-06-11 03:04:57","top_language"]