✨ (core): Añade Route, RoutePath y Waypoint
`Route` resuelve URLs sensibles al `Context`/idioma en propiedades de componentes; `RoutePath` (renombrado desde html/route.rs) es el valor concreto de ruta + query. `Waypoint` transporta la URL de retorno entre pantallas de listado/alta/edición vía query string. Ajusta `Context::route()`, `Redirect` y los componentes que aceptan rutas para integrarse con el nuevo tipo `Route`.
This commit is contained in:
parent
6f82da220b
commit
af548b03c9
25 changed files with 819 additions and 216 deletions
|
|
@ -1,6 +1,8 @@
|
|||
use crate::html::{Markup, html};
|
||||
use crate::{AutoDefault, Getters};
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
/// Error producido durante el renderizado de un componente.
|
||||
///
|
||||
/// Se usa en [`Component::prepare()`](super::Component::prepare) para devolver
|
||||
|
|
@ -22,7 +24,8 @@ use crate::{AutoDefault, Getters};
|
|||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(AutoDefault, Debug, Getters)]
|
||||
#[derive(AutoDefault, Debug, Error, Getters)]
|
||||
#[error("{message}")]
|
||||
pub struct ComponentError {
|
||||
/// Mensaje descriptivo del error.
|
||||
message: String,
|
||||
|
|
@ -57,11 +60,3 @@ impl ComponentError {
|
|||
self.fallback
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for ComponentError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for ComponentError {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue