Start with a working example
Follow the getting started guide to initialize a struct with init! and init_in.
inplace-init is a no_std-friendly Rust library for constructing a value in caller-provided storage. Initializers can write a complete value or build a struct one field at a time. A receipt keeps exclusive access to the result and is responsible for dropping it.
Use the movable APIs for ordinary values. Use the pinned APIs when construction needs the value’s final address, such as for a self-referential type. The derive and initializer macros generate the field projection and type-state plumbing.
Start with a working example
Follow the getting started guide to initialize a struct with init! and init_in.
Build with a derive
Use #[derive(Init)] for a type-state builder and per-field defaults.
Keep an address stable
Learn when to use pin_init! and pin_init_local! and how #[pin] fields are checked.
Look up an API
Browse the macro syntax and runtime API.
InitSlot represents one exclusive, uninitialized destination.InitReceipt that owns the value’s destruction responsibility.Pin.The default feature set is no_std and does not enable allocation. Enable alloc for boxed initialization and allocation-backed collection defaults; enable std for HashMap and HashSet defaults.