config: add app-id window criteria
This commit is contained in:
parent
6ef7655dbd
commit
da64166e82
13 changed files with 102 additions and 24 deletions
|
|
@ -9,8 +9,10 @@ use crate::{
|
|||
pub type TlmMatchString<T> = CritMatchString<ToplevelData, T>;
|
||||
|
||||
pub type TlmMatchTitle = TlmMatchString<TitleAccess>;
|
||||
pub type TlmMatchAppId = TlmMatchString<AppIdAccess>;
|
||||
|
||||
pub struct TitleAccess;
|
||||
pub struct AppIdAccess;
|
||||
|
||||
impl StringAccess<ToplevelData> for TitleAccess {
|
||||
fn with_string(data: &ToplevelData, f: impl FnOnce(&str) -> bool) -> bool {
|
||||
|
|
@ -21,3 +23,13 @@ impl StringAccess<ToplevelData> for TitleAccess {
|
|||
&roots.title
|
||||
}
|
||||
}
|
||||
|
||||
impl StringAccess<ToplevelData> for AppIdAccess {
|
||||
fn with_string(data: &ToplevelData, f: impl FnOnce(&str) -> bool) -> bool {
|
||||
f(&data.app_id.borrow())
|
||||
}
|
||||
|
||||
fn nodes(roots: &RootMatchers) -> &TlmRootMatcherMap<TlmMatchString<Self>> {
|
||||
&roots.app_id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue