pub struct NameRegexFilter { /* private fields */ }Expand description
Filters adapters by name pattern (pure matcher, no include/exclude semantics).
This filter simply checks if the adapter name matches the regex pattern.
Use with FilterChain to apply include/exclude logic.
§Examples
use ddns_a::network::filter::{NameRegexFilter, AdapterFilter};
use ddns_a::network::{AdapterSnapshot, AdapterKind};
let filter = NameRegexFilter::new(r"^eth").unwrap();
let eth0 = AdapterSnapshot::new("eth0", AdapterKind::Ethernet, vec![], vec![]);
let wlan0 = AdapterSnapshot::new("wlan0", AdapterKind::Wireless, vec![], vec![]);
assert!(filter.matches(ð0));
assert!(!filter.matches(&wlan0));Implementations§
Trait Implementations§
Source§impl AdapterFilter for NameRegexFilter
impl AdapterFilter for NameRegexFilter
Source§fn matches(&self, adapter: &AdapterSnapshot) -> bool
fn matches(&self, adapter: &AdapterSnapshot) -> bool
Returns
true if the adapter should be included, false to filter it out.Auto Trait Implementations§
impl Freeze for NameRegexFilter
impl RefUnwindSafe for NameRegexFilter
impl Send for NameRegexFilter
impl Sync for NameRegexFilter
impl Unpin for NameRegexFilter
impl UnwindSafe for NameRegexFilter
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
Mutably borrows from an owned value. Read more