pub struct RegexCache { /* private fields */ }Expand description
有界正则缓存:由 crate::tools::Tools 拥有并随应用生命周期冻结。
取代历史进程级 EMAIL_REGEX/PHONE_REGEX/REGEX_CACHE 三个 static:资源所有权
收口到 Tools,动态条目数有上限(Self::cap),单条正则有编译内存硬上限。
未启用 validator feature 时退化为仅含 cap 的空壳,调用链签名在两种 feature
组合下保持一致。
Implementations§
Trait Implementations§
Source§impl Clone for RegexCache
impl Clone for RegexCache
Source§impl Debug for RegexCache
impl Debug for RegexCache
Auto Trait Implementations§
impl Forget for RegexCache
impl Freeze for RegexCache
impl Move for RegexCache
impl RefUnwindSafe for RegexCache
impl Send for RegexCache
impl Sync for RegexCache
impl Unpin for RegexCache
impl UnsafeUnpin for RegexCache
impl UnwindSafe for RegexCache
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