Enum jsonpath_rust::path::config::cache::RegexCache
source · pub enum RegexCache<T = DefaultRegexCacheInst>where
T: Clone + RegexCacheInst,{
Absent,
Implemented(T),
}
Expand description
The option to provide a cache for regex
use serde_json::json;
use jsonpath_rust::JsonPathQuery;
use jsonpath_rust::path::config::cache::{DefaultRegexCacheInst, RegexCache};
use jsonpath_rust::path::config::JsonPathConfig;
let cfg = JsonPathConfig::new(RegexCache::Implemented(DefaultRegexCacheInst::default()));
let json = Box::new(json!({
"author":"abcd(Rees)",
}));
let _v = (json, cfg).path("$.[?(@.author ~= '.*(?i)d\\(Rees\\)')]")
.expect("the path is correct");
Variants§
Implementations§
source§impl<T> RegexCache<T>where
T: Clone + RegexCacheInst,
impl<T> RegexCache<T>where
T: Clone + RegexCacheInst,
pub fn is_implemented(&self) -> bool
pub fn get_instance(&self) -> Result<&T, RegexCacheError>
pub fn instance(instance: T) -> Self
Trait Implementations§
source§impl<T> Clone for RegexCache<T>
impl<T> Clone for RegexCache<T>
source§fn clone(&self) -> RegexCache<T>
fn clone(&self) -> RegexCache<T>
Returns a copy 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 moreAuto Trait Implementations§
impl<T> Freeze for RegexCache<T>where
T: Freeze,
impl<T> RefUnwindSafe for RegexCache<T>where
T: RefUnwindSafe,
impl<T> Send for RegexCache<T>where
T: Send,
impl<T> Sync for RegexCache<T>where
T: Sync,
impl<T> Unpin for RegexCache<T>where
T: Unpin,
impl<T> UnwindSafe for RegexCache<T>where
T: UnwindSafe,
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