Struct reserve_port::ReservedPortFinder
source · pub struct ReservedPortFinder<const MIN: u16, const MAX: u16> { /* private fields */ }
Implementations§
source§impl<const MIN: u16, const MAX: u16> ReservedPortFinder<MIN, MAX>
impl<const MIN: u16, const MAX: u16> ReservedPortFinder<MIN, MAX>
pub fn new() -> Self
sourcepub fn reserve_port(&mut self, port: u16)
pub fn reserve_port(&mut self, port: u16)
Sets a port to be permanently reserved.
Reservations only affect this port scanner.
pub fn reserve_random_tcp( &mut self, ip: IpAddr ) -> Option<(TcpListener, SocketAddr)>
pub fn reserve_random_port(&mut self) -> Option<u16>
pub fn free_port(&mut self, port: u16)
Auto Trait Implementations§
impl<const MIN: u16, const MAX: u16> RefUnwindSafe for ReservedPortFinder<MIN, MAX>
impl<const MIN: u16, const MAX: u16> Send for ReservedPortFinder<MIN, MAX>
impl<const MIN: u16, const MAX: u16> Sync for ReservedPortFinder<MIN, MAX>
impl<const MIN: u16, const MAX: u16> Unpin for ReservedPortFinder<MIN, MAX>
impl<const MIN: u16, const MAX: u16> UnwindSafe for ReservedPortFinder<MIN, MAX>
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