pub struct Sanitizer { /* private fields */ }Expand description
Sanitizer for input text
Implementations§
Source§impl Sanitizer
impl Sanitizer
Sourcepub fn with_allowed_chars(self, chars: &[char]) -> Self
pub fn with_allowed_chars(self, chars: &[char]) -> Self
Add additional allowed characters to the sanitizer
Sourcepub fn sanitize(&self, input: &str) -> SanitizeResult
pub fn sanitize(&self, input: &str) -> SanitizeResult
Sanitize the input text, ensuring it contains only allowed characters
Returns the sanitized string if successful, or an error message if invalid characters are found
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sanitizer
impl RefUnwindSafe for Sanitizer
impl Send for Sanitizer
impl Sync for Sanitizer
impl Unpin for Sanitizer
impl UnsafeUnpin for Sanitizer
impl UnwindSafe for Sanitizer
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