Expand description
Crate-level #[miniextendr] defaults read from the user crateβs manifest.
Proc-macro invocations share no state, so a default meant for every
#[miniextendr] item in a crate cannot be declared on one macro call:
miniextendr_init! expands with no knowledge of the functions and vice
versa. The one place every expansion can see is the manifest. Cargo sets
CARGO_MANIFEST_DIR for the crate being compiled and the proc macro runs
inside that rustc process, so it can read Cargo.toml at expansion time.
Cargo refingerprints a package when its manifest changes, so an edit takes
effect on the next build with no stale expansions.
Supported spelling (the table header; dotted keys under [package] or
[package.metadata] are accepted too, inline tables are rejected):
[package.metadata.miniextendr]
noexport_postfix = "_impl"
source_tags = true
call_attribution = "caller"
conversion_error_class = ["pkg_error_argument", "pkg_error"]
preconditions = false
roxygen_prose_links = "keep"The reader is a deliberately small line-based scanner rather than a TOML dependency: the macro crate ships in every downstream build, and the only values it needs are strings, booleans and a single-line string array under one well-known table.
StructsΒ§
- Crate
Config π - Crate-wide defaults declared under
[package.metadata.miniextendr]. - Crate
Config πError - A malformed
[package.metadata.miniextendr]entry, reported as a compile error on the#[miniextendr]item that tried to use it.
ConstantsΒ§
- CALL_
ATTRIBUTION_ πKEY - Dotted path of the
call_attributionkey. - CONVERSION_
ERROR_ πCLASS_ KEY - Dotted path of the
conversion_error_classkey. - FRAMEWORK_
ERROR_ πCLASSES - The classes the R raise helper appends to every Rust error. A crate-level class naming one of them would duplicate a layer of the vector.
- NOEXPORT_
POSTFIX_ πKEY - Dotted path of the
noexport_postfixkey. - PRECONDITIONS_
KEY π - Dotted path of the
preconditionskey. - ROXYGEN_
PROSE_ πLINKS_ KEY - Dotted path of the
roxygen_prose_linkskey. - SOURCE_
TAGS_ πKEY - Dotted path of the
source_tagskey. - TABLE_
KEY π - Dotted path of the table itself, used to reject the inline-table spelling.
FunctionsΒ§
- conversion_
error_ πclass - The crate-level classes of argument-conversion conditions
(
conversion_error_class), empty when unset. - crate_
config π - The crate config for the crate currently being compiled.
- crate_
config_ πfor_ dir crate_configfor an explicit manifest directory (the cached entry point).- normalize_
key π - Collapse a dotted key or table header to
a.b.c: trims each segment and strips one layer of quotes so[ "package" . metadata ]compares equal to[package.metadata]. - parse_
bool_ πvalue - Parse a TOML boolean, allowing a trailing
# comment. - parse_
crate_ πconfig - Parse the
[package.metadata.miniextendr]table out of manifest text. - parse_
string_ πarray_ value - Parse a single-line TOML array of strings (
["a", 'b'], a trailing comma and a trailing# commentallowed), each element under theparse_string_valuerules. Multi-line arrays and non-string elements returnNone. - parse_
string_ πvalue - Parse a single-line TOML basic (
"...") or literal ('...') string. - preconditions_
default π - The crate default of the type-derived R-side checks (
preconditions),Nonewhen unset. - read_
crate_ πconfig - Read and parse one manifest. Missing or unreadable files yield the defaults.
- roxygen_
prose_ πlinks - What leading doc-comment prose does with its
[...]links (roxygen_prose_links),ProseLinks::Stripwhen unset. - source_
tags_ πenabled - Whether generated roxygen blocks carry
@sourceprovenance tags. - validate_
conversion_ πerror_ class conversion_error_classmust name at least one class, each non-empty, distinct, and not one of the frameworkβs own layers (rust_error,simpleError,error,condition), which are always appended.- validate_
noexport_ πpostfix - Mirror of
miniextendr_fn::validate_postfixfor the manifest value.