// @generated by ferrovue from client/stores/. Do not edit: change the store files and run // `ferrovue`. //! The Pinia stores' state, which components read while they render on the server. use std::borrow::Cow; /// `BasketState` in `client/stores/basket.ts`. #[derive(Debug, Clone, serde::Serialize)] #[cfg_attr(test, derive(Default, serde::Deserialize))] #[cfg_attr(test, serde(default))] pub struct BasketState<'a> { pub owner: Cow<'a, str>, pub ids: Vec>, } impl<'a> BasketState<'a> { /// BasketState with its required fields. pub fn new(owner: impl Into>, ids: impl IntoIterator>>) -> Self { BasketState { owner: owner.into(), ids: ids.into_iter().map(Into::into).collect() } } } /// Every store's state, keyed by id as `pinia.state.value` is: what the page sends the client. #[derive(Debug, Clone, serde::Serialize)] #[cfg_attr(test, derive(Default, serde::Deserialize))] #[cfg_attr(test, serde(default))] pub struct Stores<'a> { pub basket: BasketState<'a>, } impl<'a> Stores<'a> { /// Stores with its required fields. pub fn new(basket: BasketState<'a>) -> Self { Stores { basket } } }