@@ -64,7 +64,7 @@ impl Scanner {
64
64
65
65
/// Runs scan_range with chunk sizes
66
66
/// If you want to run RustScan normally, this is the entry point used
67
- /// Returns all open ports as Vec<u16>
67
+ /// Returns all open ports as ` Vec<u16>`
68
68
/// Added by wasuaje - 01/26/2024:
69
69
/// Filtering port against exclude port list
70
70
pub async fn run ( & self ) -> Vec < SocketAddr > {
@@ -116,14 +116,16 @@ impl Scanner {
116
116
117
117
/// Given a socket, scan it self.tries times.
118
118
/// Turns the address into a SocketAddr
119
- /// Deals with the <result> type
119
+ /// Deals with the ` <result>` type
120
120
/// If it experiences error ErrorKind::Other then too many files are open and it Panics!
121
121
/// Else any other error, it returns the error in Result as a string
122
122
/// If no errors occur, it returns the port number in Result to signify the port is open.
123
123
/// This function mainly deals with the logic of Results handling.
124
124
/// # Example
125
125
///
126
- /// self.scan_socket(socket)
126
+ /// ```compile_fail
127
+ /// scanner.scan_socket(socket)
128
+ /// ```
127
129
///
128
130
/// Note: `self` must contain `self.ip`.
129
131
async fn scan_socket ( & self , socket : SocketAddr ) -> io:: Result < SocketAddr > {
@@ -169,13 +171,16 @@ impl Scanner {
169
171
/// Performs the connection to the socket with timeout
170
172
/// # Example
171
173
///
172
- /// let port: u16 = 80
173
- /// // ip is an IpAddr type
174
- /// let ip = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
175
- /// let socket = SocketAddr::new(ip, port);
176
- /// self.connect(socket)
177
- /// // returns Result which is either Ok(stream) for port is open, or Er for port is closed.
178
- /// // Timeout occurs after self.timeout seconds
174
+ /// ```compile_fail
175
+ /// # use std::net::{IpAddr, Ipv6Addr, SocketAddr};
176
+ /// let port: u16 = 80;
177
+ /// // ip is an IpAddr type
178
+ /// let ip = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
179
+ /// let socket = SocketAddr::new(ip, port);
180
+ /// scanner.connect(socket);
181
+ /// // returns Result which is either Ok(stream) for port is open, or Er for port is closed.
182
+ /// // Timeout occurs after self.timeout seconds
183
+ /// ```
179
184
///
180
185
async fn connect ( & self , socket : SocketAddr ) -> io:: Result < TcpStream > {
181
186
let stream = io:: timeout (
0 commit comments