pub struct Raw<T>(pub T);Expand description
Marks a string-like value as trusted HTML and writes it without escaping.
Raw accepts any value implementing AsRef<str>. It is useful for
pre-rendered markup, but it bypasses the escaping normally applied to strings.
Never wrap untrusted or user-controlled input in Raw.
§Example
use avosetta::{Html, Raw};
let mut output = String::new();
Raw("<em>already rendered</em>").write(&mut output);
assert_eq!(output, "<em>already rendered</em>");Tuple Fields§
§0: TTrait Implementations§
impl<T: Copy> Copy for Raw<T>
impl<T: Eq> Eq for Raw<T>
Source§impl<T: Ord> Ord for Raw<T>
impl<T: Ord> Ord for Raw<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for Raw<T>
impl<T: PartialOrd> PartialOrd for Raw<T>
impl<T: PartialEq> StructuralPartialEq for Raw<T>
Auto Trait Implementations§
impl<T> Freeze for Raw<T>where
T: Freeze,
impl<T> RefUnwindSafe for Raw<T>where
T: RefUnwindSafe,
impl<T> Send for Raw<T>where
T: Send,
impl<T> Sync for Raw<T>where
T: Sync,
impl<T> Unpin for Raw<T>where
T: Unpin,
impl<T> UnsafeUnpin for Raw<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Raw<T>where
T: UnwindSafe,
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