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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CookbookWebState
impl RefUnwindSafe for CookbookWebState
impl Send for CookbookWebState
impl Sync for CookbookWebState
impl Unpin for CookbookWebState
impl UnsafeUnpin for CookbookWebState
impl UnwindSafe for CookbookWebState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more