Trait for types that support wildcard-based filter matching in export operations.
| 114 | |
| 115 | /// Trait for types that support wildcard-based filter matching in export operations. |
| 116 | pub trait WildcardFilterable { |
| 117 | /// Returns true if this instance matches the given filter (AND logic within a single filter). |
| 118 | fn matches_filter(&self, filter: &Self) -> bool; |
| 119 | |
| 120 | /// Returns true if this instance matches any of the given filters (OR logic between filters). |
| 121 | fn matches_any_filter(&self, filters: &[Self]) -> bool |
| 122 | where |
| 123 | Self: Sized, |
| 124 | { |
| 125 | filters.iter().any(|filter| self.matches_filter(filter)) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /// Returns the computer name from the COMPUTERNAME environment variable, or "localhost" as fallback. |
| 130 | pub fn get_computer_name() -> String { |