config: add exe client criteria
This commit is contained in:
parent
cc734a135c
commit
a6257910bb
13 changed files with 85 additions and 2 deletions
|
|
@ -16,9 +16,11 @@ pub type ClmMatchSandboxEngine = ClmMatchString<AcceptorMetadataAccess<SandboxEn
|
|||
pub type ClmMatchSandboxAppId = ClmMatchString<AcceptorMetadataAccess<SandboxAppIdField>>;
|
||||
pub type ClmMatchSandboxInstanceId = ClmMatchString<AcceptorMetadataAccess<SandboxInstanceIdField>>;
|
||||
pub type ClmMatchComm = ClmMatchString<CommAccess>;
|
||||
pub type ClmMatchExe = ClmMatchString<ExeAccess>;
|
||||
|
||||
pub struct AcceptorMetadataAccess<T>(PhantomData<T>);
|
||||
pub struct CommAccess;
|
||||
pub struct ExeAccess;
|
||||
|
||||
trait SandboxField: Sized + 'static {
|
||||
fn field(meta: &AcceptorMetadata) -> &Option<String>;
|
||||
|
|
@ -89,3 +91,13 @@ impl StringAccess<Rc<Client>> for CommAccess {
|
|||
&roots.comm
|
||||
}
|
||||
}
|
||||
|
||||
impl StringAccess<Rc<Client>> for ExeAccess {
|
||||
fn with_string(data: &Rc<Client>, f: impl FnOnce(&str) -> bool) -> bool {
|
||||
f(&data.pid_info.exe)
|
||||
}
|
||||
|
||||
fn nodes(roots: &RootMatchers) -> &ClmRootMatcherMap<ClmMatchString<Self>> {
|
||||
&roots.exe
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue