| Crates.io | bridgerust-macros |
| lib.rs | bridgerust-macros |
| version | 0.1.2 |
| created_at | 2026-01-05 08:08:06.689088+00 |
| updated_at | 2026-01-13 14:54:51.671453+00 |
| description | Procedural macros for BridgeRust framework |
| homepage | https://bridgerust.dev |
| repository | https://github.com/bridgerust/bridgerust |
| max_upload_size | |
| id | 2023389 |
| size | 43,523 |
Procedural macros for the BridgeRust framework.
Website: bridgerust.dev
This crate provides the core macros used to expose Rust code to Python and Node.js. It is re-exported by the main bridgerust crate and should generally not be used directly.
#[export]Marks a function, struct, or impl block for export to Python and Node.js.
use bridgerust::export;
#[export]
pub fn greet(name: String) -> String {
format!("Hello, {}!", name)
}
#[constructor]Marks a method within an impl block as the constructor (__init__ in Python, constructor in JS).
use bridgerust::export;
#[export]
pub struct Client {
url: String,
}
#[export]
impl Client {
#[constructor]
pub fn new(url: String) -> Self {
Self { url }
}
}
#[error]Registers a custom error type for cross-language error handling.
This project is licensed under either of
at your option.