Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/webui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ pub use webui_handler::route_handler::{
ProtocolIndex,
};
pub use webui_handler::route_matcher::CompiledRouteCache;
pub use webui_handler::{plugin::HandlerPlugin, HandlerError, ResponseWriter, WebUIHandler};
pub use webui_handler::Result as HandlerResult;
pub use webui_handler::{plugin::HandlerPlugin, HandlerError, RenderOptions, ResponseWriter, WebUIHandler};
pub use webui_parser::CssStrategy;
pub use webui_parser::DomStrategy;
pub use webui_parser::Plugin;
Expand Down
16 changes: 9 additions & 7 deletions docs/guide/integrations/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ The `webui` crate provides high-performance build and rendering of WebUI protoco

```toml
[dependencies]
webui = "*" # see https://crates.io/crates/webui for latest version
microsoft-webui = "*" # see https://crates.io/crates/microsoft-webui for latest version
serde_json = "1"
```

The crate is published as `microsoft-webui` on crates.io; the bare `webui` name is owned by an unrelated project. Cargo's default rename rules mean items remain importable as `use webui::...` because the crate sets `[lib] name = "webui"` internally.

## Examples

<webui-tabs>
Expand All @@ -27,11 +29,11 @@ use std::fs;
struct StringWriter(String);

impl ResponseWriter for StringWriter {
fn write(&mut self, content: &str) -> webui_handler::Result<()> {
fn write(&mut self, content: &str) -> webui::HandlerResult<()> {
self.0.push_str(content);
Ok(())
}
fn end(&mut self) -> webui_handler::Result<()> { Ok(()) }
fn end(&mut self) -> webui::HandlerResult<()> { Ok(()) }
}

#[actix_web::main]
Expand Down Expand Up @@ -70,11 +72,11 @@ use std::{fs, sync::Arc};
struct StringWriter(String);

impl ResponseWriter for StringWriter {
fn write(&mut self, content: &str) -> webui_handler::Result<()> {
fn write(&mut self, content: &str) -> webui::HandlerResult<()> {
self.0.push_str(content);
Ok(())
}
fn end(&mut self) -> webui_handler::Result<()> { Ok(()) }
fn end(&mut self) -> webui::HandlerResult<()> { Ok(()) }
}

#[tokio::main]
Expand Down Expand Up @@ -112,11 +114,11 @@ use std::{fs, sync::Arc};
struct StringWriter(String);

impl ResponseWriter for StringWriter {
fn write(&mut self, content: &str) -> webui_handler::Result<()> {
fn write(&mut self, content: &str) -> webui::HandlerResult<()> {
self.0.push_str(content);
Ok(())
}
fn end(&mut self) -> webui_handler::Result<()> { Ok(()) }
fn end(&mut self) -> webui::HandlerResult<()> { Ok(()) }
}

#[tokio::main]
Expand Down
Loading