rikonaka / pistol-rs

A Rust Library about Cybersecurity and Nmap
Apache License 2.0
73 stars 8 forks source link

Scan module structs are hidden #10

Closed rwygand closed 6 months ago

rwygand commented 6 months ago

Hi, not sure when or if this changed I cannot write this function:

fn scan() -> Result<ArpScanResults> {
    let target: Target = Target::from_subnet("192.168.0.0/24", None)?;
    let threads_num = 300;
    let timeout = Some(Duration::new(1, 5));
    let src_ipv4 = None;
    arp_scan(target, src_ipv4, threads_num, timeout)
}

as I cannot import pistol::scan::ArpScanResults:

error[E0603]: module `scan` is private
  --> src/scanner.rs:4:13
   |
4  | use pistol::scan::ArpScanResults;
   |             ^^^^ private module
   |
note: the module `scan` is defined here
  --> .../pistol-rs-575476176e5e4305/e198bc5/src/lib.rs:16:1
   |
16 | mod scan;
   | ^^^^^^^^

I think a pub mod scan; in lib.rs will fix it, though that may expose a lot of things you don't want to expose. If that's the case, i think you can selectively re-export the structs you'd want.

Thanks!

rikonaka commented 6 months ago

Hi @rwygand , thank you very much! 👍👍