pub struct PortCache { /* private fields */ }Expand description
A TTL cache of host:port reachability.
A bulk scan aims many checks at the same handful of ports; without this, every check would pay its own connect timeout against a port that is already known to be closed. Entries live for 30 seconds and the map is capped so a long run cannot grow without bound.
Implementations§
Source§impl PortCache
impl PortCache
Sourcepub fn global() -> Arc<Self> ⓘ
pub fn global() -> Arc<Self> ⓘ
Process-wide cache so back-to-back checks in ruso scan reuse state.
Sourcepub fn endpoints_for_run(
spec: &ProgramSpec,
base_url: &str,
) -> Vec<(String, u16)>
pub fn endpoints_for_run( spec: &ProgramSpec, base_url: &str, ) -> Vec<(String, u16)>
Endpoints to probe before running: socket probes in the spec plus --target host:port for HTTP checks.
Sourcepub async fn check_for_run(
&self,
spec: &ProgramSpec,
base_url: &str,
) -> (Vec<PortCheck>, Option<(String, u16)>)
pub async fn check_for_run( &self, spec: &ProgramSpec, base_url: &str, ) -> (Vec<PortCheck>, Option<(String, u16)>)
Probe every endpoint for this run; returns checks and the first closed (host, port) if any.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PortCache
impl !RefUnwindSafe for PortCache
impl Send for PortCache
impl Sync for PortCache
impl Unpin for PortCache
impl UnsafeUnpin for PortCache
impl UnwindSafe for PortCache
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