[−][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
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl !UnwindSafe for Rules
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,