pub struct CookbookWebState { /* private fields */ }Expand description
Cookbook state exposed by the WebUI route and JSON API.
Implementations§
Source§impl CookbookWebState
impl CookbookWebState
Sourcepub fn seeded() -> Result<Self>
pub fn seeded() -> Result<Self>
Build a WebUI state from the crate-shipped seeded recipe books.
Sourcepub fn seeded_with_books(extra: &[(&str, EmbeddedDir)]) -> Result<Self>
pub fn seeded_with_books(extra: &[(&str, EmbeddedDir)]) -> Result<Self>
Build a WebUI state from the seeded books PLUS extra books injected by the
host (COOK8.02 facade injection). The seeded set covers the lower-graph
domains sim-lib-cookbook can depend on directly; a host above the cookbook
(sim-web-shell, the sim facade) passes its own higher-graph recipe books
here – which cannot be seed-deps of the engine without a cycle – so the
browsable catalog grows toward full coverage. A book that fails to register
is skipped rather than blanking the whole catalog; it simply does not appear.
Sourcepub fn from_store(store: RecipeStore) -> Self
pub fn from_store(store: RecipeStore) -> Self
Build a WebUI state from an existing recipe store.
Sourcepub fn store(&self) -> &RecipeStore
pub fn store(&self) -> &RecipeStore
Access the backing cookbook store.
Sourcepub fn handle_request(
&self,
method: &str,
target: &str,
cx: Option<&mut Cx>,
) -> CookbookWebResponse
pub fn handle_request( &self, method: &str, target: &str, cx: Option<&mut Cx>, ) -> CookbookWebResponse
Route one cookbook WebUI request.
target is an HTTP request target such as /api/cookbook?q=x. The run
endpoint requires a runtime context because it executes the same
sim-lib-cookbook recipe runner used by the runtime ops and CLI.
Trait Implementations§
Source§impl Clone for CookbookWebState
impl Clone for CookbookWebState
Source§fn clone(&self) -> CookbookWebState
fn clone(&self) -> CookbookWebState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more