#[non_exhaustive]pub struct TargetContext<'a> {
pub keywords: Option<ResolverFn<'a>>,
pub zones: Option<ZoneResolverFn<'a>>,
pub hosts: Option<HostLookup<'a>>,
}Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.keywords: Option<ResolverFn<'a>>Expands keywords such as lan into the addresses they stand for.
zones: Option<ZoneResolverFn<'a>>Resolves the %interface suffix on a link-local address to a scope id.
hosts: Option<HostLookup<'a>>Resolves a hostname to addresses.
Implementations§
Source§impl<'a> TargetContext<'a>
impl<'a> TargetContext<'a>
Sourcepub fn new() -> Self
pub fn new() -> Self
A context that can resolve nothing: literal addresses, ranges and CIDR blocks only.
Sourcepub fn with_keywords(self, keywords: ResolverFn<'a>) -> Self
pub fn with_keywords(self, keywords: ResolverFn<'a>) -> Self
Sets the keyword resolver.
Sourcepub fn with_zones(self, zones: ZoneResolverFn<'a>) -> Self
pub fn with_zones(self, zones: ZoneResolverFn<'a>) -> Self
Sets the interface-zone resolver.
Sourcepub fn with_hosts(self, hosts: HostLookup<'a>) -> Self
pub fn with_hosts(self, hosts: HostLookup<'a>) -> Self
Sets the hostname lookup.
Trait Implementations§
Source§impl<'a> Clone for TargetContext<'a>
impl<'a> Clone for TargetContext<'a>
impl<'a> Copy for TargetContext<'a>
Source§impl Debug for TargetContext<'_>
impl Debug for TargetContext<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TargetContext<'a>
impl<'a> !UnwindSafe for TargetContext<'a>
impl<'a> Freeze for TargetContext<'a>
impl<'a> Send for TargetContext<'a>
impl<'a> Sync for TargetContext<'a>
impl<'a> Unpin for TargetContext<'a>
impl<'a> UnsafeUnpin for TargetContext<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
Converts
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> ⓘ
Converts
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