Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #4

Merged
merged 8 commits into from
Apr 4, 2023
Merged

Dev #4

merged 8 commits into from
Apr 4, 2023

Conversation

wiresock
Copy link
Contributor

No description provided.

@wiresock wiresock requested a review from conectado March 29, 2023 13:11
Copy link

@conectado conectado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some nit-picky comments but looks good!

Comment on lines +702 to +716
/// Print detailed information about a network packet.
///
/// This function takes an `IntermediateBuffer` containing a network packet and prints various
/// details about the packet, such as Ethernet, IPv4, IPv6, ICMPv4, ICMPv6, UDP, and TCP information.
///
/// # Arguments
///
/// * `packet` - A mutable reference to an `ndisapi::IntermediateBuffer` containing the network packet.
///
/// # Examples
///
/// ```no_run
/// let mut packet: ndisapi::IntermediateBuffer = ...;
/// print_packet_info(&mut packet);
/// ```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functions in example are not exposed therefore docs aren't generated.

So we shouldn't write examples here or comments with ///. We can just write:
// Print into stdout detailed information about a network packet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right, the documentation won't be generated. However, I find convenient to have the function information highlighted in Visual Studio Code. See the screenshot below:
image
If I replace '///' to '//' it changes to
image

examples/listadapters.rs Outdated Show resolved Hide resolved
Comment on lines +158 to +173

/// Print detailed information about a network packet.
///
/// This function takes an `IntermediateBuffer` containing a network packet and prints various
/// details about the packet, such as Ethernet, IPv4, IPv6, ICMPv4, ICMPv6, UDP, and TCP information.
///
/// # Arguments
///
/// * `packet` - A mutable reference to an `ndisapi::IntermediateBuffer` containing the network packet.
///
/// # Examples
///
/// ```no_run
/// let mut packet: ndisapi::IntermediateBuffer = ...;
/// print_packet_info(&mut packet);
/// ```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above for comments in examples

@@ -174,3 +118,85 @@ fn main() -> Result<()> {

Ok(())
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
@wiresock wiresock merged commit 8d4a5ee into main Apr 4, 2023
@wiresock wiresock deleted the dev branch April 4, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants