pub struct ResolveNatInterval { /* private fields */ }
Expand description
With this type you can resolve the external public IP address on an interval basis.
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 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 Freeze for ResolveNatInterval
impl !RefUnwindSafe for ResolveNatInterval
impl Send for ResolveNatInterval
impl !Sync for ResolveNatInterval
impl Unpin for ResolveNatInterval
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§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>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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: 72 bytes