Skip to main content

Crate bstack_raii_derive

Crate bstack_raii_derive 

Source
Expand description

Procedural macros for bstack_raii.

Three entry points:

  • bstack_block — attribute macro. Turns an ergonomic struct into a parallel #[repr(C, packed)] on-disk representation plus generated accessors, BStackDrop, BStackCast, and (for (rc, weak)) BStackWeakable impls.
  • bstack_move — function-like macro. Destructures a BStackOwned<X>, transferring ownership of every field out as a tuple of typed handles.
  • bstack_cast — function-like macro. Direction-inferring typed/untyped handle conversion.

Macros§

bstack_cast
bstack_cast!(expr as Target) — type-checked handle conversion. The target is given explicitly (a function-like macro can’t read a let annotation) and selects the direction:
bstack_move
bstack_move!(handle) / bstack_move!(owned, allocator) — transfer every field out of a block, freeing only the parent shell.

Attribute Macros§

bstack_block
#[bstack_block] — generate the on-disk layout and typed handle machinery.
bstack_class
#[bstack_class] — a #[bstack_block] that also persists RTTI.
bstack_enum
#[bstack_enum] — a tagged-union block.