urd-derive
Procedural derive macro for the [ExternObject] trait from the urd
scripting language runtime.
Usage
use urd::prelude::*;
#[derive(ExternObject)]
#[extern_object(type_name = "Player")]
struct Player {
hp: i32,
name: String,
#[extern_object(readonly)]
id: u64,
#[extern_object(skip)]
internal: SomeInternalType,
#[extern_object(rename = "pos_x")]
position_x: f64,
}
Attributes
Container-level (#[extern_object(...)] on the struct)
| Attribute |
Description |
type_name = "..." |
Override the type name returned by ExternObject::type_name(). Defaults to the struct name. |
Field-level (#[extern_object(...)] on a field)
| Attribute |
Description |
skip |
Omit this field entirely — not readable, not writable, not listed. |
readonly |
Field is readable but not writable from scripts. |
rename = "..." |
Expose the field under a different name in scripts. |