config: add title window criteria
This commit is contained in:
parent
2b5be7fbd9
commit
6ef7655dbd
14 changed files with 109 additions and 23 deletions
|
|
@ -20,3 +20,4 @@ macro_rules! fixed_root_criterion {
|
|||
|
||||
pub mod tlmm_client;
|
||||
pub mod tlmm_kind;
|
||||
pub mod tlmm_string;
|
||||
|
|
|
|||
23
src/criteria/tlm/tlm_matchers/tlmm_string.rs
Normal file
23
src/criteria/tlm/tlm_matchers/tlmm_string.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use crate::{
|
||||
criteria::{
|
||||
crit_matchers::critm_string::{CritMatchString, StringAccess},
|
||||
tlm::{RootMatchers, TlmRootMatcherMap},
|
||||
},
|
||||
tree::ToplevelData,
|
||||
};
|
||||
|
||||
pub type TlmMatchString<T> = CritMatchString<ToplevelData, T>;
|
||||
|
||||
pub type TlmMatchTitle = TlmMatchString<TitleAccess>;
|
||||
|
||||
pub struct TitleAccess;
|
||||
|
||||
impl StringAccess<ToplevelData> for TitleAccess {
|
||||
fn with_string(data: &ToplevelData, f: impl FnOnce(&str) -> bool) -> bool {
|
||||
f(&data.title.borrow())
|
||||
}
|
||||
|
||||
fn nodes(roots: &RootMatchers) -> &TlmRootMatcherMap<TlmMatchString<Self>> {
|
||||
&roots.title
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue