#[macro_export]
macro_rules! __registration_face {
{
source: $source:expr,
collector: $collector:ident,
kind: $kind:ident,
preset: $preset:ty,
preset_name: $preset_name:expr,
parts: $parts:ty,
parts_name: $parts_name:expr,
name: { zh: $name_zh:expr, en: $name_en:expr $(,)? },
summary: { zh: $summary_zh:expr, en: $summary_en:expr $(,)? },
params: $params:expr,
exports: [$($export:expr),* $(,)?],
handle: $handle:ident,
handle_name: $handle_name:expr,
$(stable_name: $stable_name:literal,)?
needs_registry: $needs_registry:expr,
registry_name: $registry_name:expr,
parent: $parent:expr,
getting_from_other_registry: $getting:expr,
registry_rule_path: $rule_path:expr,
registry_rule: $rule:expr,
$(admission: $admission:expr,)?
$(handle_traits: [$($handle_trait:literal),* $(,)?],)?
$(handle_contracts: [$($handle_contract:path),* $(,)?],)?
$(part_traits: [$($part_trait:literal),* $(,)?],)?
$(part_contracts: [$($part_contract:path),* $(,)?],)?
requires: [$($require:expr => $provider:expr),* $(,)?],
provides: [$($provide:expr),* $(,)?],
$(flow: $flow:expr,)?
$(flow_provider: $flow_provider:path,)?
$(plugin: $plugin:expr,)?
runtime_checks: [$($runtime_check:expr),* $(,)?] $(,)?
} => {
const _: () = $crate::assert_contract::<$preset, $parts>();
$crate::__assert_impls!($handle; [$($($handle_contract),*)?]);
$crate::__assert_impls!($parts; [$($($part_contract),*)?]);
pub const NODE_ID: $crate::NodeId = $crate::NodeId::from_namespaced_path(
env!("CARGO_PKG_NAME"),
$source,
stringify!($kind),
);
#[doc(hidden)]
pub type __Preset = $preset;
#[doc(hidden)]
pub type __Parts = $parts;
pub const REGISTRATION: $crate::RegistrationInfo = $crate::RegistrationInfo {
namespace: env!("CARGO_PKG_NAME"),
id: NODE_ID,
parent: $parent,
kind: stringify!($kind),
preset: $preset_name,
parts: $parts_name,
params: $params,
handle: $handle_name,
stable_name: $crate::__stable_name!($($stable_name)?),
name: $crate::LocalizedText { zh: $name_zh, en: $name_en },
summary: $crate::LocalizedText { zh: $summary_zh, en: $summary_en },
exports: &[$($export),*],
needs_registry: $needs_registry,
registry_name: $registry_name,
getting_from_other_registry: $getting,
registry_rule_path: $rule_path,
registry_rule: $rule,
admission: $crate::__admission!($($admission)?),
requires: &[$($crate::RequirementSpec {
capability: $require,
provider: $provider,
}),*],
provides: &[$($provide),*],
contract: $crate::ObjectContract {
required_parts: <$preset as $crate::PresetContract>::REQUIRED_PARTS,
provided_parts: <$parts as $crate::PartsContract>::PROVIDED_PARTS,
},
flow: $crate::__flow_select!($($flow)?; $($flow_provider)?),
flow_provider: $crate::__flow_provider!($($flow_provider)?),
handle_traits: $crate::__face_trait_labels_or!(
[$($($handle_contract),*)?]; [$($($handle_trait),*)?]
),
part_traits: $crate::__face_trait_labels_or!(
[$($($part_contract),*)?]; [$($($part_trait),*)?]
),
runtime_checks: &[$($runtime_check),*],
plugin: $crate::__plugin!($($plugin)?),
source: $crate::SourceLocation {
file: $source,
line: line!(),
column: column!(),
function: $handle_name,
},
};
$crate::__submit_registration!($collector; REGISTRATION);
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! __submit_registration {
(development; $registration:ident) => {};
(debug; $registration:ident) => {
#[cfg(debug_assertions)]
::nichlink_debug_method::submit! { $registration }
};
(linked; $registration:ident) => {
};
}