Expand description
§rustra-macros — rustra용 proc macro
#[command] 속성 매크로와 register! / build! 매크로를 제공합니다.
직접 이 crate를 사용하지 말고 rustra crate를 통해 사용하세요:
use rustra::prelude::*;
#[bridge_type]
struct AddInput { a: i64, b: i64 }
#[bridge_type]
struct AddOutput { sum: i64 }
#[command]
fn add_numbers(input: AddInput) -> Result<AddOutput> {
Ok(AddOutput { sum: input.a + input.b })
}Macros§
- build
#[command]함수들을 간결하게 등록하는 매크로입니다.- register
- Registers
#[command]functions with a package builder.
Attribute Macros§
- bridge_
type - struct/enum에 bridge에 필요한 derive와 serde 설정을 자동 추가하는 속성 매크로입니다.
- command
- 함수를 rustra 명령으로 등록하는 속성 매크로입니다.