pub struct Unescaped(pub String);
Expand description
Wrapper to insert unescaped content into a rust_html template. Never use Unescaped on untrusted user input!
use rust_html::{rhtml, Unescaped};
let sketchy_user_input = "<script>".to_string();
let safe_template = rhtml! { "{sketchy_user_input}" };
assert_eq!(String::from(safe_template), "<script>");
let unescaped = Unescaped(sketchy_user_input.clone());
let unsafe_template = rhtml! { "{unescaped}" };
assert_eq!(String::from(unsafe_template), "<script>");
Tuple Fields§
§0: String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Unescaped
impl RefUnwindSafe for Unescaped
impl Send for Unescaped
impl Sync for Unescaped
impl Unpin for Unescaped
impl UnwindSafe for Unescaped
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