pub struct ResolveNatInterval { /* private fields */ }Expand description
With this type you can resolve the external public IP address on an interval basis.
Keeps at most one resolution in flight and skips missed interval ticks.
Implementations§
Source§impl ResolveNatInterval
impl ResolveNatInterval
Sourcepub fn interval(resolver: NatResolver, period: Duration) -> Self
pub fn interval(resolver: NatResolver, period: Duration) -> Self
Creates a new ResolveNatInterval that attempts to resolve the public IP with interval of
period. See also [tokio::time::interval]
Sourcepub fn interval_at(
resolver: NatResolver,
start: Instant,
period: Duration,
) -> Self
pub fn interval_at( resolver: NatResolver, start: Instant, period: Duration, ) -> Self
Creates a new ResolveNatInterval that attempts to resolve the public IP with interval of
period with the first attempt starting at start. See also [tokio::time::interval_at]
Sourcepub const fn resolver(&self) -> &NatResolver
pub const fn resolver(&self) -> &NatResolver
Returns the resolver used by this interval
Sourcepub async fn tick(&mut self) -> Option<IpAddr>
pub async fn tick(&mut self) -> Option<IpAddr>
Completes when the next IpAddr in the interval has been reached.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ResolveNatInterval
impl !Sync for ResolveNatInterval
impl !UnwindSafe for ResolveNatInterval
impl Freeze for ResolveNatInterval
impl Send for ResolveNatInterval
impl Unpin for ResolveNatInterval
impl UnsafeUnpin for ResolveNatInterval
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes