pub struct FilteredFetcher<F, A> { /* private fields */ }Expand description
A fetcher decorator that applies a filter to results.
This wraps any AddressFetcher and filters the returned adapters
using the provided AdapterFilter.
§Type Parameters
F: The inner fetcher type (implementsAddressFetcher)A: The filter type (implementsAdapterFilter)
§Examples
ⓘ
use ddns_a::network::filter::{FilteredFetcher, FilterChain, KindFilter};
use ddns_a::network::{AdapterKind, platform::WindowsFetcher};
let filter = FilterChain::new()
.exclude(KindFilter::new([AdapterKind::Virtual, AdapterKind::Loopback]));
let fetcher = FilteredFetcher::new(WindowsFetcher::new(), filter);
let adapters = fetcher.fetch()?; // Only non-virtual, non-loopback adaptersImplementations§
Source§impl<F, A> FilteredFetcher<F, A>
impl<F, A> FilteredFetcher<F, A>
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Consumes the filtered fetcher and returns the inner fetcher.
Trait Implementations§
Source§impl<F: AddressFetcher, A: AdapterFilter> AddressFetcher for FilteredFetcher<F, A>
impl<F: AddressFetcher, A: AdapterFilter> AddressFetcher for FilteredFetcher<F, A>
Source§fn fetch(&self) -> Result<Vec<AdapterSnapshot>, FetchError>
fn fetch(&self) -> Result<Vec<AdapterSnapshot>, FetchError>
Fetches the current state of all network adapters. Read more
Auto Trait Implementations§
impl<F, A> Freeze for FilteredFetcher<F, A>
impl<F, A> RefUnwindSafe for FilteredFetcher<F, A>where
F: RefUnwindSafe,
A: RefUnwindSafe,
impl<F, A> Send for FilteredFetcher<F, A>
impl<F, A> Sync for FilteredFetcher<F, A>
impl<F, A> Unpin for FilteredFetcher<F, A>
impl<F, A> UnwindSafe for FilteredFetcher<F, A>where
F: UnwindSafe,
A: UnwindSafe,
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