/// - Try to avoid using `no_default` on any configuration element unless you truly want the user
/// ### `deftly(tor_config(no_serialize_trait))` — Don't derive Serialize for the builder struct
/// ### `deftly(tor_config(no_deserialize_trait))` — Don't derive Deserialize for the builder struct
/// ### `deftly(tor_config(no_flattenable_trait))` — Don't derive Flattenable for the builder struct
/// ### `deftly(tor_config(no_extendbuilder_trait))` — Don't derive ExtendBuilder for the builder struct
/// > This attribute's name ends with `_trait` to remind the caller that the Builder struct itself
/// ### `deftly(tor_config(no_buildable_trait))` — Don't derive Buildable for the config struct
/// This attribute passes its contents through to a new attribute on the derived builder struct.
/// ### `deftly(tor_config(build_fn(error = "..")))` — Change return error type of the build method.
/// ### `deftly(tor_config(build_fn(missing_field = "..")))` — Code to generate a missing field error.
/// > Don't use this option on any config struct that's always present with a multiplicity of one,
/// When this attribute is provided, you can completely override the way that this field is constructed.
/// > Be careful with this attribute: it can lead to counterintuitive behavior for the end user.
/// ### `deftly(tor_config(try_build = ".."))` — Call a fallible function to build this field.
/// When this attribute is provided, you can completely override the way that this field is constructed.
/// > Be careful with this attribute: it can lead to counterintuitive behavior for the end user.
/// ### `deftly(tor_config(sub_builder(build_fn = "...")))` — Call a different function on this sub-builder
/// ### `deftly(tor_config(no_sub_builder))` — Allow a Buildable field _without_ a sub_builder.
/// Usually, the name of the list type alias and builder object based on the struct and the field name.
/// ### `deftly(tor_config(list(element(build)))` — Declare that the list builder contains sub-builders.
/// ### `deftly(tor_config(list(element(clone)))` — Declare that the list builder objects should be cloned directly.
/// Usually, the name of the map type alias and builder object based on the struct and the field name.
/// ### `deftly(tor_config(setter(vis = "..")))` — Change the visibility of the setter function
/// When this option is provided, the setter instead expects an argument of type `impl Into<T>`,
/// ### `deftly(tor_config(setter(try_into)))` — Have the setter function accept `impl TryInto<T>`
/// When this option is provided, the setter instead expects an argument of type `impl TryInto<T>`,
/// ### `deftly(tor_config(setter(strip_option)))` — Have the setter for `Option<T>` accept `T`
/// ### `deftly(tor_config(field(vis = "..")))` — Change the visibility of a field in the builder
/// ### `deftly(tor_config(serde = "..")))` — Apply a serde attribute to the field in the builder
/// ### `deftly(tor_config(extend_with = ""))` — Change the ExtendBuilder behavior for a field.
/// This option causes a field in the builder to be conditionally present or absent at compile time,
/// ### `deftly(tor_config(cfg_reject))` — Reject the configuration when a feature is missing.
/// * Every field must have some default behavior specified, or must have the `no_default` option given.
/// (With `derive_builder`, `no_default` is the default, which can result in confusing test failures.)
/// * There is `post_build` attribute to replace the pattern where we would rename the build function,
/// * The list builder and map builder patterns are supported via attributes; you don't need separate
/// | `Option<String>` | [`OptionStringOrStr`] | `String, &str, Option<String>, Option<&str>` |
/// | `Option<NonZero<T>>` | [`OptionPossiblyBoundsChecked`]`<T>` | `T, NonZero<T>, Option<T>, Option<NonZero<T>> `|
// - derive-deftly#109 would let us have better syntax for tmeta:attr, fmeta:attr, and fmeta:serde.
/// - `@build_type {ty}` - The type that should be used as `T` for the builder field's `Option<T>`.
/// - `@setter_cvt {ty} {e}`- Code to run inside the setter to convert {e} into a `@build_type {ty}`
/// - `@check_type {ty}` - Make sure that it is not a bug for this type to have reached this position.
{ @$cmd:ident {$( $($(::)? std::)? num:: )? NonZero $(::)? < $t:ty >} $($args:tt)*} => { $crate::derive::nonzero_typemagic!{ @$cmd {$t} $($args)* } };
{ @$cmd:ident {$( $($(::)? std::)? num:: )? NonZeroU8} $($args:tt)*} => { $crate::derive::nonzero_typemagic!{ @$cmd {u8} $($args)* } };
{ @$cmd:ident {$( $($(::)? std::)? num:: )? NonZeroU16} $($args:tt)*} => { $crate::derive::nonzero_typemagic!{ @$cmd {u16} $($args)* } };
{ @$cmd:ident {$( $($(::)? std::)? num:: )? NonZeroU32} $($args:tt)*} => { $crate::derive::nonzero_typemagic!{ @$cmd {u32} $($args)* } };
{ @$cmd:ident {$( $($(::)? std::)? num:: )? NonZeroU64} $($args:tt)*} => { $crate::derive::nonzero_typemagic!{ @$cmd {u64} $($args)* } };
{ @$cmd:ident {$( $($(::)? std::)? num:: )? NonZeroU128} $($args:tt)*} => { $crate::derive::nonzero_typemagic!{ @$cmd {u128} $($args)* } };
{ @$cmd:ident {$( $($(::)? std::)? string:: )? String} $($args:tt)*} => { $crate::derive::string_typemagic! { @$cmd $($args)* } };
{ @$cmd:ident {$($t:tt)+} $($args:tt)*} => { $crate::derive::no_typemagic! { @$cmd {$($t)+} $($args)* } };
{ @setter_arg_type {$t:ty} } => { impl $crate::setter_traits::OptionPossiblyBoundsChecked<$t> };
{ {$e:expr} {$($t:tt)+}} => { $crate::derive::normalize_and_invoke!{ @setter_cvt {$($t)+} {$e} } };
{ {$e:expr} {$fname:expr} {$($t:tt)+}} => { $crate::derive::normalize_and_invoke!{ @build_field {$($t)+} {$e} {$fname} } };
/// We use this trait to detect cases that normalize_and_invoke should have handled, but didn't--
/// Define a builder type for a given type, with settings appropriate to participate in the Arti
$SETTER_VIS fn $SETTER_NAME $SETTER_GENS (&mut self, val: $SETTER_INPUT_TYPE) -> $SETTER_RETURN_TYPE {
#[doc = ${concat "Return a new [`" $tname " Builder`] to construct an instance of this type."}]