pub struct AnchorDef {
pub name: String,
pub parent: Option<String>,
pub selector: SelectorPath,
pub tier: Tier,
pub pid: Option<u32>,
pub process_name: Option<String>,
pub mount_depth: usize,
}Expand description
Declaration of a named anchor.
Fields§
§name: StringUnique name (used as a key in plans, conditions, actions).
parent: Option<String>Parent anchor to resolve the selector relative to.
None means the selector is applied to desktop application windows.
selector: SelectorPathCSS-like path from the parent to this element.
tier: Tier§pid: Option<u32>Optional PID to pin this anchor to a specific process. When set, resolution filters application windows by PID before applying the selector, preventing accidental attachment to a different process.
process_name: Option<String>Optional process name filter (case-insensitive, without .exe).
When set, resolution only considers windows whose owning process name
matches this string. Can be used instead of or alongside pid.
mount_depth: usizeSubflow depth at which this anchor was mounted. Set by ShadowDom::mount()
so cleanup_depth can remove anchors introduced by a subflow regardless
of their tier (including Root anchors that are not depth-prefixed).
Implementations§
Source§impl AnchorDef
impl AnchorDef
pub fn root(name: impl Into<String>, selector: SelectorPath) -> Self
pub fn session(name: impl Into<String>, selector: SelectorPath) -> Self
Sourcepub fn with_pid(self, pid: u32) -> Self
pub fn with_pid(self, pid: u32) -> Self
Pin this anchor to a specific process. Resolution will only match windows
belonging to that PID, preventing accidental attachment to unrelated
windows with the same title. Can be chained onto any constructor:
AnchorDef::session("notepad", sel).with_pid(notepad_pid)