urd-derive 0.1.0

Derive macros for the urd scripting language
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 14.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 305.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • metdxt/urd
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • metdxt

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.