pub struct Match<M> { /* private fields */ }Expand description
The Match filter
Implementations§
Source§impl<M> Match<M>where
M: Matchable,
impl<M> Match<M>where
M: Matchable,
Sourcepub fn new(key: &str) -> Self
pub fn new(key: &str) -> Self
Examples found in repository?
example/match.rs (line 19)
6fn main() {
7 let json = json!({
8 "Object": {
9 "explanation": "test explanation",
10 "activeRegionNum": 23
11 },
12 "2022-01-11": {
13 "Object2": {
14 "explanation": "none",
15 "activeRegionNum": 98
16 }
17 }
18 });
19 let nums = filter::<Match<u64>>(json, &Match::new("activeRegionNum")).unwrap();
20 assert_eq!(vec![23 as u64, 98 as u64], nums);
21 dbg!(nums);
22}Trait Implementations§
Source§impl<'de, M> Deserialize<'de> for Match<M>where
M: Deserialize<'de>,
impl<'de, M> Deserialize<'de> for Match<M>where
M: Deserialize<'de>,
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
impl<M> StructuralPartialEq for Match<M>
Auto Trait Implementations§
impl<M> Freeze for Match<M>
impl<M> RefUnwindSafe for Match<M>where
M: RefUnwindSafe,
impl<M> Send for Match<M>where
M: Send,
impl<M> Sync for Match<M>where
M: Sync,
impl<M> Unpin for Match<M>where
M: Unpin,
impl<M> UnwindSafe for Match<M>where
M: 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