Struct iroh_net::portmapper::Client
source · pub struct Client { /* private fields */ }Expand description
Port mapping client.
Implementations§
source§impl Client
impl Client
sourcepub async fn default() -> Self
pub async fn default() -> Self
Creates a client that uses the default configuration.
See Config::default.
sourcepub fn probe(&self) -> Receiver<Result<ProbeOutput, String>>
pub fn probe(&self) -> Receiver<Result<ProbeOutput, String>>
Request a probe to the port mapping protocols.
Returns the oneshot::Receiver used to obtain the result of the probe.
sourcepub fn procure_mapping(&self)
pub fn procure_mapping(&self)
Try to get a mapping for the last local port if there isn’t one already.
sourcepub fn update_local_port(&self, local_port: NonZeroU16)
pub fn update_local_port(&self, local_port: NonZeroU16)
Update the local port.
If the port changes, this will trigger a port mapping attempt.
sourcepub fn deactivate(&self)
pub fn deactivate(&self)
Deactivate port mapping.
sourcepub fn watch_external_address(&self) -> Receiver<Option<SocketAddrV4>>
pub fn watch_external_address(&self) -> Receiver<Option<SocketAddrV4>>
Watch the external address for changes in the mappings.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§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