pub struct WebUIHandler { /* private fields */ }Expand description
The main WebUI handler that processes protocols and renders them.
The handler is stateless: plugin instances are created per-render from
the stored factory function, allowing concurrent renders with &self.
Implementations§
Source§impl WebUIHandler
impl WebUIHandler
Sourcepub fn with_plugin(factory: fn() -> Box<dyn HandlerPlugin>) -> Self
pub fn with_plugin(factory: fn() -> Box<dyn HandlerPlugin>) -> Self
Create a new WebUI handler with a plugin factory.
Each render call creates a fresh plugin instance from the factory,
enabling concurrent renders with &self.
Sourcepub fn render<'a>(
&self,
protocol: &'a Protocol,
state: &'a Value,
options: &RenderOptions<'a>,
writer: &'a mut dyn ResponseWriter,
) -> Result<()>
pub fn render<'a>( &self, protocol: &'a Protocol, state: &'a Value, options: &RenderOptions<'a>, writer: &'a mut dyn ResponseWriter, ) -> Result<()>
Render the UI based on the protocol and state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebUIHandler
impl RefUnwindSafe for WebUIHandler
impl Send for WebUIHandler
impl Sync for WebUIHandler
impl Unpin for WebUIHandler
impl UnsafeUnpin for WebUIHandler
impl UnwindSafe for WebUIHandler
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