pub trait HtmlSafe: Display { }Expand description
Types that implement this marker trait don’t need to be HTML escaped
Please note that this trait is only meant as speed-up helper. In some odd circumcises askama
might still decide to HTML escape the input, so if this must not happen, then you need to use
the |safe filter to prevent the auto escaping.
If you are unsure if your type generates HTML safe output in all cases, then DON’T mark it. Better safe than sorry!
Implementations on Foreign Types§
impl HtmlSafe for bool
impl HtmlSafe for f32
impl HtmlSafe for f64
impl HtmlSafe for i8
impl HtmlSafe for i16
impl HtmlSafe for i32
impl HtmlSafe for i64
impl HtmlSafe for i128
impl HtmlSafe for isize
impl HtmlSafe for u8
impl HtmlSafe for u16
impl HtmlSafe for u32
impl HtmlSafe for u64
impl HtmlSafe for u128
impl HtmlSafe for usize
impl HtmlSafe for NonZeroI8
impl HtmlSafe for NonZeroI16
impl HtmlSafe for NonZeroI32
impl HtmlSafe for NonZeroI64
impl HtmlSafe for NonZeroI128
impl HtmlSafe for NonZeroIsize
impl HtmlSafe for NonZeroU8
impl HtmlSafe for NonZeroU16
impl HtmlSafe for NonZeroU32
impl HtmlSafe for NonZeroU64
impl HtmlSafe for NonZeroU128
impl HtmlSafe for NonZeroUsize
impl<T> HtmlSafe for Cow<'_, T>
Available on crate feature
alloc only.impl<T: HtmlSafe + ?Sized> HtmlSafe for &T
impl<T: HtmlSafe + ?Sized> HtmlSafe for &mut T
impl<T: HtmlSafe + ?Sized> HtmlSafe for Box<T>
Available on crate feature
alloc only.impl<T: HtmlSafe + ?Sized> HtmlSafe for Rc<T>
Available on crate feature
alloc only.impl<T: HtmlSafe + ?Sized> HtmlSafe for Arc<T>
Available on crate feature
alloc only.impl<T: HtmlSafe + ?Sized> HtmlSafe for Ref<'_, T>
impl<T: HtmlSafe + ?Sized> HtmlSafe for RefMut<'_, T>
impl<T: HtmlSafe + ?Sized> HtmlSafe for MutexGuard<'_, T>
Available on crate feature
std only.impl<T: HtmlSafe + ?Sized> HtmlSafe for RwLockReadGuard<'_, T>
Available on crate feature
std only.impl<T: HtmlSafe + ?Sized> HtmlSafe for RwLockWriteGuard<'_, T>
Available on crate feature
std only.