[−][src]Struct sanitize_html::rules::Rules
structure to describe sanitization rules
Fields
allow_comments: bool
Determines if comments are kept of stripped out of a document.
allowed_elements: HashMap<String, Element>
Allowed elements.
delete_elements: HashSet<String>
Elements which will be removed together with their children.
space_elements: HashSet<String>
Elements which will be replaced by spaces (Their children will be processed recursively).
rename_elements: HashMap<String, String>
Elements which will be renamed.
Methods
impl Rules
[src]
pub fn new() -> Self
[src]
Creates a new rules set.
pub fn allow_comments(self, allow_comments: bool) -> Self
[src]
Sets if comments are allowed
pub fn element(self, element: Element) -> Self
[src]
Adds a rule for an allowed element
pub fn delete(self, element_name: &str) -> Self
[src]
Adds a rule to delete an element
pub fn space(self, element_name: &str) -> Self
[src]
Adds a rule to replace an element with space
pub fn rename(self, element_name: &str, to: &str) -> Self
[src]
Adds a rule to rename an element
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,