Implementa Debug en comp./tipos principales

This commit is contained in:
Manuel Cillero 2026-03-21 11:26:02 +01:00
parent c3feff9efd
commit a0b14aec36
21 changed files with 61 additions and 32 deletions

View file

@ -4,7 +4,7 @@ use crate::prelude::*;
///
/// Los bloques se utilizan como contenedores de otros componentes o contenidos, con un título
/// opcional y un cuerpo que sólo se renderiza si existen componentes hijos (*children*).
#[derive(AutoDefault, Getters)]
#[derive(AutoDefault, Debug, Getters)]
pub struct Block {
#[getters(skip)]
id: AttrId,

View file

@ -1,5 +1,7 @@
use crate::prelude::*;
use std::fmt;
/// Componente básico que renderiza dinámicamente código HTML según el contexto.
///
/// Este componente permite generar contenido HTML arbitrario, usando la macro `html!` y accediendo
@ -31,6 +33,14 @@ use crate::prelude::*;
/// ```
pub struct Html(Box<dyn Fn(&mut Context) -> Markup + Send + Sync>);
impl fmt::Debug for Html {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("Html")
.field(&"Fn(&mut Context) -> Markup")
.finish()
}
}
impl Default for Html {
fn default() -> Self {
Self::with(|_| html! {})

View file

@ -76,7 +76,7 @@ pub enum IntroOpening {
/// })),
/// );
/// ```
#[derive(Getters)]
#[derive(Debug, Getters)]
pub struct Intro {
/// Devuelve el título de entrada.
title: L10n,

View file

@ -8,7 +8,7 @@ const LINK: &str = "<a href=\"https://pagetop.cillero.es\" rel=\"noopener norefe
/// Por defecto, usando [`default()`](Self::default) sólo se muestra un reconocimiento a PageTop.
/// Sin embargo, se puede usar [`new()`](Self::new) para crear una instancia con un texto de
/// copyright predeterminado.
#[derive(AutoDefault, Getters)]
#[derive(AutoDefault, Debug, Getters)]
pub struct PoweredBy {
/// Devuelve el texto de copyright actual, si existe.
copyright: Option<String>,