pub struct CompiledPattern { /* private fields */ }Expand description
A regex pattern compiled once at construction or deserialisation time.
Stores both the compiled Regex and the source string so that the rule
remains Clone / PartialEq / Serialize without needing to
recompile on every match. Compilation errors surface at the construction
site (e.g. schema load) rather than per-request on the validation hot path.
Implementations§
Trait Implementations§
Source§impl Clone for CompiledPattern
impl Clone for CompiledPattern
Source§fn clone(&self) -> CompiledPattern
fn clone(&self) -> CompiledPattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompiledPattern
impl Debug for CompiledPattern
Source§impl<'de> Deserialize<'de> for CompiledPattern
impl<'de> Deserialize<'de> for CompiledPattern
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CompiledPattern
impl Display for CompiledPattern
Source§impl PartialEq for CompiledPattern
impl PartialEq for CompiledPattern
Source§impl Serialize for CompiledPattern
impl Serialize for CompiledPattern
Source§impl TryFrom<&str> for CompiledPattern
impl TryFrom<&str> for CompiledPattern
Source§impl TryFrom<String> for CompiledPattern
impl TryFrom<String> for CompiledPattern
impl Eq for CompiledPattern
Auto Trait Implementations§
impl Freeze for CompiledPattern
impl RefUnwindSafe for CompiledPattern
impl Send for CompiledPattern
impl Sync for CompiledPattern
impl Unpin for CompiledPattern
impl UnsafeUnpin for CompiledPattern
impl UnwindSafe for CompiledPattern
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.