reinhardt-urls 0.3.0

URL routing and proxy utilities for Reinhardt framework
Documentation
//! Metadata for route-backed page components.

/// Compile-time metadata exposed by props types generated by `#[component]`.
pub trait ComponentInfo {
	/// Returns the client route pattern.
	fn path() -> &'static str;

	/// Returns the route name used for reverse lookup.
	fn name() -> &'static str;

	/// Returns the PascalCase component name used by `page!` brace form.
	fn component_name() -> &'static str;

	/// Returns the snake_case render function name.
	fn function_name() -> &'static str;

	/// Returns the generated props type name.
	fn props_type_name() -> &'static str;
}

/// Static metadata submitted by `#[component]` for diagnostics and tooling.
pub struct ComponentMetadata {
	/// Client route pattern.
	pub path: &'static str,
	/// Route name used by `ClientRouter`.
	pub name: &'static str,
	/// PascalCase component name.
	pub component_name: &'static str,
	/// Render function name.
	pub function_name: &'static str,
	/// Generated props type name.
	pub props_type_name: &'static str,
	/// Rust module path containing the component declaration.
	pub module_path: &'static str,
}

inventory::collect!(ComponentMetadata);