Struct sanitize_html::rules::Rules
source · pub struct Rules {
pub allow_comments: bool,
pub allowed_elements: HashMap<String, Element>,
pub delete_elements: HashSet<String>,
pub space_elements: HashSet<String>,
pub rename_elements: HashMap<String, String>,
}
Expand description
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.
Implementations
sourceimpl Rules
impl Rules
sourcepub fn allow_comments(self, allow_comments: bool) -> Self
pub fn allow_comments(self, allow_comments: bool) -> Self
Sets if comments are allowed
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more