pub struct IgnoreRule { /* private fields */ }Expand description
A single ignore predicate: matches when both the process-name and window-title predicates match (logical AND).
Construct with IgnoreRule::builder. Both fields default to their
Any variant, so omitting a setter means “don’t constrain on that
dimension”. .process_name(s) accepts any Into<String> and is sugar
for ProcessNameMatch::Exact; .window_title(m) takes a
WindowTitleMatch directly.
§Example
use focus_tracker_core::{IgnoreRule, WindowTitleMatch};
// Ignore Explorer.EXE only when it has no title.
let rule = IgnoreRule::builder()
.process_name("Explorer.EXE")
.window_title(WindowTitleMatch::Missing)
.build();
assert!(rule.matches("Explorer.EXE", None));
assert!(!rule.matches("Explorer.EXE", Some("Documents")));Implementations§
Source§impl IgnoreRule
impl IgnoreRule
Sourcepub fn builder() -> IgnoreRuleBuilder
pub fn builder() -> IgnoreRuleBuilder
Builds an ignore rule. Both fields default to their Any variant.
.process_name(s) takes a string and stores
ProcessNameMatch::Exact; omit the setter to leave the
process-name predicate as ProcessNameMatch::Any. To match any
process and constrain only on title, omit .process_name(...).
Source§impl IgnoreRule
impl IgnoreRule
Sourcepub fn process_name_match(&self) -> &ProcessNameMatch
pub fn process_name_match(&self) -> &ProcessNameMatch
Returns the rule’s process-name predicate.
Sourcepub fn window_title_match(&self) -> &WindowTitleMatch
pub fn window_title_match(&self) -> &WindowTitleMatch
Returns the rule’s window-title predicate.
Trait Implementations§
Source§impl Clone for IgnoreRule
impl Clone for IgnoreRule
Source§fn clone(&self) -> IgnoreRule
fn clone(&self) -> IgnoreRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IgnoreRule
impl Debug for IgnoreRule
Source§impl FromIterator<IgnoreRule> for IgnoreRules
impl FromIterator<IgnoreRule> for IgnoreRules
Source§fn from_iter<I>(iter: I) -> IgnoreRuleswhere
I: IntoIterator<Item = IgnoreRule>,
fn from_iter<I>(iter: I) -> IgnoreRuleswhere
I: IntoIterator<Item = IgnoreRule>,
Source§impl PartialEq for IgnoreRule
impl PartialEq for IgnoreRule
Source§fn eq(&self, other: &IgnoreRule) -> bool
fn eq(&self, other: &IgnoreRule) -> bool
self and other values to be equal, and is used by ==.impl Eq for IgnoreRule
impl StructuralPartialEq for IgnoreRule
Auto Trait Implementations§
impl Freeze for IgnoreRule
impl RefUnwindSafe for IgnoreRule
impl Send for IgnoreRule
impl Sync for IgnoreRule
impl Unpin for IgnoreRule
impl UnsafeUnpin for IgnoreRule
impl UnwindSafe for IgnoreRule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more