📝 Añade no_run a doctests ilustrativos
This commit is contained in:
parent
41c4379bc3
commit
511149caa7
26 changed files with 57 additions and 57 deletions
|
|
@ -3,7 +3,7 @@
|
|||
//! Agrupa los *traits*, macros y tipos del sistema de entidades de SeaORM, junto con las funciones
|
||||
//! [`dbconn`], [`execute`], [`fetch_all`] y [`fetch_one`], en una sola importación:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! use pagetop_seaorm::db::*;
|
||||
//! ```
|
||||
//!
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
//!
|
||||
//! ## Definir una entidad
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! use pagetop_seaorm::db::*;
|
||||
//!
|
||||
//! #[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
//! El módulo [`api`] re-exporta el crate `sea_orm` íntegro bajo ese alias. Úsalo cuando necesites
|
||||
//! un tipo o función que no esté expuesto directamente en `db::*`:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! use pagetop_seaorm::db::api;
|
||||
//!
|
||||
//! // Tipos o utilidades no incluidos en db::*:
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
//! El módulo [`query`] re-exporta `sea_query` para construir las sentencias SQL que se pasan a
|
||||
//! [`fetch_all`] y [`fetch_one`]. Es el compañero natural de esas funciones dentro del módulo `db`:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! use pagetop_seaorm::db::*;
|
||||
//! use pagetop_seaorm::db::query::*;
|
||||
//!
|
||||
|
|
@ -193,7 +193,7 @@ pub fn dbconn() -> &'static DatabaseConnection {
|
|||
/// > **Advertencia:** nunca interpoles valores externos en la cadena SQL directamente. Para
|
||||
/// > sentencias con parámetros de usuario usa el sistema de entidades.
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// use pagetop_seaorm::db::*;
|
||||
///
|
||||
/// async fn example() -> Result<(), DbErr> {
|
||||
|
|
@ -224,7 +224,7 @@ pub async fn execute(stmt: impl Into<String>) -> Result<ExecResult, DbErr> {
|
|||
/// Los valores se integran como literales escapados, no como parámetros de base de datos. Para
|
||||
/// datos procedentes del usuario, el sistema de entidades es más robusto.
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// use pagetop_seaorm::db::*;
|
||||
/// use pagetop_seaorm::db::query::*;
|
||||
///
|
||||
|
|
@ -274,7 +274,7 @@ pub async fn fetch_all<Q: query::QueryStatementWriter>(
|
|||
/// Los valores se integran como literales escapados, no como parámetros de base de datos. Para
|
||||
/// datos procedentes del usuario, el sistema de entidades es más robusto.
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// use pagetop_seaorm::db::*;
|
||||
/// use pagetop_seaorm::db::query::*;
|
||||
///
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
//!
|
||||
//! Con una sola importación tienes todo lo necesario:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! use pagetop_seaorm::migration::*;
|
||||
//! ```
|
||||
//!
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ pub fn derive_auto_default(input: TokenStream) -> TokenStream {
|
|||
///
|
||||
/// Si defines un método `with_` como este:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop_macros::builder_fn;
|
||||
/// # struct Example {value: Option<String>};
|
||||
/// # impl Example {
|
||||
|
|
@ -140,7 +140,7 @@ pub fn derive_auto_default(input: TokenStream) -> TokenStream {
|
|||
///
|
||||
/// la macro reescribirá el método `with_` y generará un nuevo método `alter_`:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # struct Example {value: Option<String>};
|
||||
/// # impl Example {
|
||||
/// #[inline]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use std::sync::Arc;
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let component = Html::with(|_| {
|
||||
/// html! {
|
||||
|
|
@ -23,7 +23,7 @@ use std::sync::Arc;
|
|||
///
|
||||
/// Para renderizar contenido que dependa del contexto, se puede acceder a él dentro del *closure*:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let component = Html::with(|cx| {
|
||||
/// let user = cx.param_or("username", "visitor".to_string());
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ pub enum IntroOpening {
|
|||
///
|
||||
/// **Intro mínima por defecto**
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default();
|
||||
/// ```
|
||||
///
|
||||
/// **Título, eslogan y botón personalizados**
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default()
|
||||
/// .with_title(L10n::l("intro_custom_title"))
|
||||
|
|
@ -54,7 +54,7 @@ pub enum IntroOpening {
|
|||
///
|
||||
/// **Sin botón y en modo *Custom* (sin *badges* predefinidos)**
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default()
|
||||
/// .with_button(None::<(L10n, FnPathByContext)>)
|
||||
|
|
@ -63,7 +63,7 @@ pub enum IntroOpening {
|
|||
///
|
||||
/// **Añadir contenidos hijo**
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default()
|
||||
/// .with_child(
|
||||
|
|
@ -221,7 +221,7 @@ impl Intro {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default().with_title(L10n::n("Intro title"));
|
||||
/// ```
|
||||
|
|
@ -235,7 +235,7 @@ impl Intro {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default().with_slogan(L10n::n("A short slogan"));
|
||||
/// ```
|
||||
|
|
@ -253,7 +253,7 @@ impl Intro {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Define un botón con texto y una URL fija.
|
||||
/// let intro = Intro::default().with_button(Some((L10n::n("Start"), |_| "/start".into())));
|
||||
|
|
@ -274,7 +274,7 @@ impl Intro {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let intro = Intro::default().with_opening(IntroOpening::Custom);
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ impl PoweredBy {
|
|||
/// Al pasar `Some(valor)` se sobrescribe el texto de copyright por defecto. Al pasar `None` se
|
||||
/// eliminará, pero en este caso es necesario especificar el tipo explícitamente:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let p1 = PoweredBy::default().with_copyright(Some("2001 © Foo Inc."));
|
||||
/// let p2 = PoweredBy::new().with_copyright(None::<String>);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ pub use context::{AssetsOp, Context, ContextError, Contextual};
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// #[derive(AutoDefault, Clone)]
|
||||
/// struct SampleComponent {
|
||||
|
|
@ -81,7 +81,7 @@ pub type FnIsRenderable = fn(cx: &Context) -> bool;
|
|||
/// El caso más común es construir rutas relativas dependientes del contexto, normalmente usando
|
||||
/// [`Context::route`](crate::core::component::Context::route):
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # let relative_route: FnPathByContext =
|
||||
/// |cx| cx.route("/path/to/page")
|
||||
|
|
@ -90,7 +90,7 @@ pub type FnIsRenderable = fn(cx: &Context) -> bool;
|
|||
///
|
||||
/// También es posible usar rutas estáticas sin asignaciones adicionales:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # let external_route: FnPathByContext =
|
||||
/// |_| "https://www.example.com".into()
|
||||
|
|
@ -99,7 +99,7 @@ pub type FnIsRenderable = fn(cx: &Context) -> bool;
|
|||
///
|
||||
/// O componer rutas dinámicas en tiempo de ejecución:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # let dynamic_route: FnPathByContext =
|
||||
/// |cx| RoutePath::new("/user").with_param("id", cx.param::<u64>("user_id").unwrap().to_string())
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ impl<C: Component> Embed<C> {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let embed = Embed::with(Html::with(|_| html! { "Prueba" }));
|
||||
/// {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ impl std::error::Error for ContextError {}
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # use pagetop_aliner::Aliner;
|
||||
/// fn prepare_context<C: Contextual>(cx: C) -> C {
|
||||
|
|
@ -123,7 +123,7 @@ pub trait Contextual: LangId {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let cx = Context::new(None)
|
||||
/// .with_param("user_id", 42_i32)
|
||||
|
|
@ -232,7 +232,7 @@ pub trait Contextual: LangId {
|
|||
///
|
||||
/// Crea un nuevo contexto asociado a una petición HTTP:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # use pagetop_aliner::Aliner;
|
||||
/// fn new_context(request: HttpRequest) -> Context {
|
||||
|
|
@ -254,7 +254,7 @@ pub trait Contextual: LangId {
|
|||
///
|
||||
/// Y hace operaciones con un contexto dado:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # #[derive(AutoDefault, Clone, Debug)]
|
||||
/// # struct Menu;
|
||||
|
|
@ -409,7 +409,7 @@ impl Context {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # let mut cx = Context::new(None);
|
||||
/// cx.push_message(MessageLevel::Warning, L10n::n("Session is not valid"));
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use crate::{AutoDefault, Getters};
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # #[derive(Clone)]
|
||||
/// # struct MyComponent;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub enum MessageLevel {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Mensaje informativo con clave traducible.
|
||||
/// let info = StatusMessage::new(MessageLevel::Info, L10n::l("saved-successfully"));
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use crate::web::Router;
|
|||
/// Este *trait* es fácil de implementar, basta con declarar una estructura sin campos para la
|
||||
/// extensión y sobrescribir los métodos que sean necesarios. Por ejemplo:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// pub struct MyExtension;
|
||||
///
|
||||
|
|
@ -48,7 +48,7 @@ pub trait Extension: AnyInfo + Send + Sync {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// pub struct MyTheme;
|
||||
///
|
||||
|
|
@ -107,7 +107,7 @@ pub trait Extension: AnyInfo + Send + Sync {
|
|||
///
|
||||
/// ## Rutas HTTP básicas
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # async fn list_posts() -> &'static str { "" }
|
||||
/// # async fn view_post() -> &'static str { "" }
|
||||
|
|
@ -126,7 +126,7 @@ pub trait Extension: AnyInfo + Send + Sync {
|
|||
///
|
||||
/// ## Rutas agrupadas bajo un prefijo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// # async fn dashboard() -> &'static str { "" }
|
||||
/// # async fn list_users() -> &'static str { "" }
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use crate::web::http::StatusCode;
|
|||
/// El único método **obligatorio** de `Extension` para un tema es [`theme()`](Extension::theme),
|
||||
/// que debe devolver una referencia al propio tema:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// pub struct MyTheme;
|
||||
///
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ impl ChildrenInRegions {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Banner global en la región de contenido.
|
||||
/// InRegion::Content.add(Html::with(|_| html! { "🎉 ¡Bienvenido!" }));
|
||||
|
|
@ -157,7 +157,7 @@ impl InRegion {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Banner global en la región por defecto.
|
||||
/// InRegion::Content.add(Html::with(|_| {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use crate::{AutoDefault, CowStr};
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let favicon = Favicon::new()
|
||||
/// // Estándar de facto admitido por todos los navegadores.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ enum Source {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Script externo con carga diferida, versión de caché y prioridad en el renderizado.
|
||||
/// let script = JavaScript::defer("/assets/js/app.js")
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ impl TargetMedia {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Crea una hoja de estilos externa con control de versión y medio específico (`screen`).
|
||||
/// let stylesheet = StyleSheet::from("/assets/css/main.css")
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use crate::locale::L10n;
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// fn render_logo(cx: &mut Context) -> Markup {
|
||||
/// html! {
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ impl<T: Default> Default for PreEscaped<T> {
|
|||
///
|
||||
/// A minimal web page:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// use pagetop::prelude::*;
|
||||
///
|
||||
/// let markup = html! {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ impl PropsOp {
|
|||
///
|
||||
/// El patrón recomendado es añadir un campo `props: Props` con su método *builder* delegado:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// #[derive(AutoDefault, Clone, Getters)]
|
||||
/// pub struct MyButton {
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ impl FromStr for UnitValue {
|
|||
/// Deserializa desde una cadena usando la misma gramática que [`FromStr`].
|
||||
///
|
||||
/// # Ejemplo con `serde_json`
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// use serde::Deserialize;
|
||||
///
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ use std::ops::Deref;
|
|||
///
|
||||
/// Útil para versionar recursos estáticos de PageTop desde otros *crates*. Por ejemplo:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// use pagetop::prelude::*;
|
||||
///
|
||||
/// pub struct MyTheme;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
//! Si los recursos se encuentran en el directorio por defecto `src/locale` del *crate*, sólo hay
|
||||
//! que declarar:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! # use pagetop::prelude::*;
|
||||
//! include_locales!(LOCALES_SAMPLE);
|
||||
//! ```
|
||||
|
|
@ -125,7 +125,7 @@ pub use l10n::L10n;
|
|||
///
|
||||
/// Uso básico con el directorio por defecto `"src/locale"`:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// include_locales!(LOCALES_SAMPLE);
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ pub trait LangId {
|
|||
/// resuelve un idioma soportado o porque se aplica el idioma por defecto o, en último término, el
|
||||
/// de respaldo (`"en-US"`):
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Idioma por defecto si no resuelve.
|
||||
/// let lang = Locale::resolve("it-IT");
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ enum L10nOp {
|
|||
///
|
||||
/// Los argumentos dinámicos se añaden con `with_arg()` o `with_args()`.
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Texto literal sin traducción.
|
||||
/// let raw = L10n::n("© 2025 PageTop").get();
|
||||
|
|
@ -128,7 +128,7 @@ impl L10n {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let text = L10n::l("greeting").with_arg("name", "Manuel").get();
|
||||
/// ```
|
||||
|
|
@ -142,7 +142,7 @@ impl L10n {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// struct ResourceLang;
|
||||
///
|
||||
|
|
@ -180,7 +180,7 @@ impl L10n {
|
|||
///
|
||||
/// # Ejemplo
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,no_run
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let html = L10n::l("welcome.message").using(&Locale::resolve("es"));
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
//! Convierte automáticamente el cuerpo de una petición con `Content-Type: application/json` en un
|
||||
//! tipo Rust fuertemente tipado, validando el formato y deserializando con *serde*.
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! # use pagetop::prelude::*;
|
||||
//! #[derive(serde::Deserialize)]
|
||||
//! struct NuevoUsuario { nombre: String, email: String }
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
//! Serializa valores Rust a JSON y genera una respuesta HTTP con el encabezado apropiado
|
||||
//! `application/json; charset=utf-8`, todo con una llamada compacta.
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,no_run
|
||||
//! # use pagetop::prelude::*;
|
||||
//! #[derive(serde::Serialize)]
|
||||
//! struct Usuario { id: u32, nombre: String }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue