pub struct EuvDebugProps {
pub label: &'static str,
pub value: Option<DebugValueFormatter>,
pub expanded: bool,
}Expand description
Props for the euv_debug component.
Defines the strongly-typed interface for the dev-only Debug
readout. The component renders a labeled <pre data-euv-debug>
block whose body is the result of invoking value on every
render, so users can inspect reactive state without breaking
out of the component tree.
value is wrapped in Option<DebugValueFormatter> (rather
than DebugValueFormatter directly) so the struct can
derive Default — the upstream #[derive(New)] macro
expects every props struct to also be Default (it generates
X::new(...) AND X::default() from the same field list).
A bare Rc<dyn Fn() -> String> has no Default impl (you
cannot synthesise an arbitrary formatter), so wrapping in
Option keeps the derive happy and gives us a sensible
“no formatter configured” fallback.
Fields§
§label: &'static strShort label printed before the value (e.g. “count”, “user”).
Rendered as <span data-euv-debug-label>{label}</span> so
styling hooks ([data-euv-debug-label]) can target it
independently from the value.
value: Option<DebugValueFormatter>Optional closure that produces the displayable string.
Runs on every render — typically the body reads one or
more Signal<T>::get() values to subscribe the readout
to live state. None renders an empty placeholder so the
caller can still construct the component without a
formatter (handy in tests and stub components).
expanded: boolWhen true, the value is rendered inside <pre> with
white-space: pre-wrap so multi-line strings (JSON,
stack traces) preserve formatting. When false, the
value is rendered inside a single-line <code>.
Implementations§
Source§impl EuvDebugProps
impl EuvDebugProps
pub fn get_label(&self) -> &'static str
pub fn get_mut_label(&mut self) -> &mut &'static str
pub fn set_label(&mut self, val: &'static str) -> &mut Self
pub fn get_value(&self) -> DebugValueFormatter
pub fn try_get_value(&self) -> &Option<DebugValueFormatter>
pub fn get_mut_value(&mut self) -> &mut Option<DebugValueFormatter>
pub fn set_value(&mut self, val: Option<DebugValueFormatter>) -> &mut Self
pub fn get_expanded(&self) -> bool
pub fn get_mut_expanded(&mut self) -> &mut bool
pub fn set_expanded(&mut self, val: bool) -> &mut Self
Source§impl EuvDebugProps
impl EuvDebugProps
Trait Implementations§
Source§impl Clone for EuvDebugProps
impl Clone for EuvDebugProps
Source§fn clone(&self) -> EuvDebugProps
fn clone(&self) -> EuvDebugProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more