// @generated by ferrovue from client/pages/[...missing].vue. Do not edit: change the `.vue` file and run // `ferrovue`. use std::borrow::Cow; use ferrovue as fv; /// The component's name, as `data-island` carries it. pub const NAME: &str = "Missing"; /// The props `[...missing].vue` declares. #[derive(Debug, Clone, serde::Serialize)] #[cfg_attr(test, derive(serde::Deserialize))] pub struct Props<'a> { pub path: Cow<'a, str>, } impl<'a> Props<'a> { /// Props with its required fields. pub fn new(path: impl Into>) -> Self { Props { path: path.into() } } } /// Write the component's server render into `out`. /// /// # Panics /// /// With the message of the refusal [`try_render`] returns. pub fn render(out: &mut String, props: &Props<'_>, fv_route: &fv::router::Route<'_>, fv_head: &fv::head::Head) { fv::render::rendered(try_render(out, props, fv_route, fv_head)); } /// [`render`], returning the refusal of a render that cannot write what Vue writes for these /// props, such as a date string browsers read differently: a server answers it with an error. /// /// # Errors /// /// The first [`fv::render::Refused`] the render met; `out` then holds what was written before it. pub fn try_render(out: &mut String, props: &Props<'_>, fv_route: &fv::router::Route<'_>, fv_head: &fv::head::Head) -> Result<(), fv::render::Refused> { out.reserve( 154 + props.path.len() ); fv_head.push(fv::head::HeadValue::object([ ("title", fv::head::HeadValue::str("Not found")), ("meta", fv::head::HeadValue::array([fv::head::HeadValue::object([ ("name", fv::head::HeadValue::str("robots")), ("content", fv::head::HeadValue::str("noindex")), ]), fv::head::HeadValue::object([ ("name", fv::head::HeadValue::str("description")), ("content", fv::head::HeadValue::str(&format!("Nothing lives at {}", props.path))), ])])), ])); out.push_str("

Not found

Nothing lives at "); fv::core::escape_into(out, &props.path); out.push_str(".

"); fv::attrs::link_named_open(out, fv_route, "/", &[], "", "", "page", "", "active", &[], false); out.push_str(">Back to all books
"); Ok(()) } /// The component's markup, for a maud page that shows it. pub fn html<'p, 'a>(props: &'p Props<'a>, fv_route: &'p fv::router::Route<'p>, fv_head: &'p fv::head::Head) -> fv::html::Html<'p, Props<'a>, impl fv::html::Renderer> + 'p> { fv::html::Html::markup(props, fv::html::Fallible(move |out: &mut String, props: &Props<'a>| try_render(out, props, fv_route, fv_head))) }