pub struct UnicodeNeutralizationConfig {
pub bidi_replacement: BiDiReplacement,
pub zero_width_action: ZeroWidthAction,
pub homograph_action: HomographAction,
}Expand description
Unicode neutralization configuration
Controls how unicode-based security threats are handled. These attacks exploit unicode features to deceive users or systems.
Fields§
§bidi_replacement: BiDiReplacementHow to handle BiDi characters
Default: Marker (visible indication) Security: BiDi characters can reverse text direction to deceive users.
Remove: Most secure, may break legitimate RTL textMarker: Balance of security and usability (recommended)Escape: Preserves data but may confuse users
zero_width_action: ZeroWidthActionAction for zero-width characters
Default: Remove (most secure) Security: Zero-width characters are invisible and used for:
- Hidden tracking codes
- Bypassing filters
- Creating invisible URLs Warning: Some languages legitimately use zero-width joiners
homograph_action: HomographActionAction for homographs
Default: Ascii (convert lookalikes) Security: Homographs look like ASCII but aren’t (е vs e).
Ascii: Converts to ASCII equivalent (most secure)Warn: Alerts but preserves (for international apps)Block: Rejects content entirely (strictest)
Trait Implementations§
Source§impl Clone for UnicodeNeutralizationConfig
impl Clone for UnicodeNeutralizationConfig
Source§fn clone(&self) -> UnicodeNeutralizationConfig
fn clone(&self) -> UnicodeNeutralizationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnicodeNeutralizationConfig
impl Debug for UnicodeNeutralizationConfig
Source§impl<'de> Deserialize<'de> for UnicodeNeutralizationConfig
impl<'de> Deserialize<'de> for UnicodeNeutralizationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for UnicodeNeutralizationConfig
impl RefUnwindSafe for UnicodeNeutralizationConfig
impl Send for UnicodeNeutralizationConfig
impl Sync for UnicodeNeutralizationConfig
impl Unpin for UnicodeNeutralizationConfig
impl UnwindSafe for UnicodeNeutralizationConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more