fix: Socket2 RAW socket Type compile error out of scope E0599#1
Open
blisabda wants to merge 1 commit into
Open
fix: Socket2 RAW socket Type compile error out of scope E0599#1blisabda wants to merge 1 commit into
blisabda wants to merge 1 commit into
Conversation
blisabda
commented
Apr 10, 2026
- Socket2 RAW socket Type need all features enabled
- Socket2 RAW socket Type need all features enabled
Author
|
Rust compiler detecting 2 error E0599 with socket2::Type::RAW struct usage. error[E0599]: no associated item named `RAW` found for struct `socket2::Type` in the current scope
--> src/session.rs:135:59
|
135 | let send_socket = Socket::new(Domain::IPV4, Type::RAW, Some(Protocol::ICMPV4))?;
| ^^^ associated item not found in `socket2::Type`
error[E0599]: no associated item named `RAW` found for struct `socket2::Type` in the current scope
--> src/session.rs:138:59
|
138 | let recv_socket = Socket::new(Domain::IPV4, Type::RAW, Some(Protocol::ICMPV4))?;
| ^^^ associated item not found in `socket2::Type`To resolve the E0599 errors when using socket2::Type::RAW, we must enable Reference: /// Type corresponding to `SOCK_RAW`.
#[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))]
#[cfg_attr(
docsrs,
doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf")))))
)]
pub const RAW: Type = Type(sys::SOCK_RAW);Footnotes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.