webui_handler/plugin/
fast.rs1pub use super::fast_v2::FastV2HydrationPlugin;
11
12#[deprecated(
17 since = "0.0.11",
18 note = "use plugin::fast_v2::FastV2HydrationPlugin for FAST 2 compatibility or plugin::fast_v3::FastV3HydrationPlugin for FAST 3"
19)]
20pub type FastHydrationPlugin = super::fast_v2::FastV2HydrationPlugin;
21
22#[cfg(test)]
23mod tests {
24 use super::*;
25 use crate::plugin::HandlerPlugin;
26 use crate::{ResponseWriter, Result};
27
28 struct TestWriter {
29 output: String,
30 }
31
32 impl TestWriter {
33 fn new() -> Self {
34 Self {
35 output: String::new(),
36 }
37 }
38 }
39
40 impl ResponseWriter for TestWriter {
41 fn write(&mut self, content: &str) -> Result<()> {
42 self.output.push_str(content);
43 Ok(())
44 }
45
46 fn end(&mut self) -> Result<()> {
47 Ok(())
48 }
49 }
50
51 #[test]
52 #[allow(deprecated)]
53 fn test_fast_alias_uses_v2_markers() {
54 let mut plugin = FastHydrationPlugin::new();
55 plugin.push_scope();
56 let mut writer = TestWriter::new();
57 assert!(plugin.on_binding_start("userName", &mut writer).is_ok());
58 assert_eq!(writer.output, "<!--fe-b$$start$$0$$userName$$fe-b-->");
59 }
60}