Skip to content

fix(types): Fix FFI enum type binding documentation generation#50

Merged
0x676e67 merged 3 commits intomainfrom
fix
Feb 22, 2025
Merged

fix(types): Fix FFI enum type binding documentation generation#50
0x676e67 merged 3 commits intomainfrom
fix

Conversation

@0x676e67
Copy link
Copy Markdown
Owner

This pull request introduces significant changes to the rnet library, including the addition of new enumerations for HTTP methods, versions, and impersonation options, as well as updates to the client and response handling code to use these new enums. The most important changes are detailed below:

New Enumerations and Refactoring:

  • Added new enumerations for Impersonate, ImpersonateOS, Method, and Version in rnet.pyi, replacing the previous class definitions. This change simplifies the handling of these types and ensures consistency across the codebase. [1] [2] [3]

  • Refactored the src/types module to use the new enums with conversion methods. This includes changes in impersonate.rs, method.rs, and version.rs to define enums with conversion and string representation methods. [1] [2] [3]

Client and Response Updates:

  • Updated the Client implementation in src/client.rs to use the new enums for Impersonate, ImpersonateOS, and Method. This includes changes to how these parameters are passed and converted in the request builder methods. [1] [2] [3]

  • Modified the Response and WebSocket implementations in src/response to use the new Version enum for handling HTTP versions. This ensures that the correct version is used and converted when processing responses. [1] [2]

Additional Changes:

  • Added a new example script examples/impersonate.py demonstrating the use of the Impersonate class with an asynchronous client request. This serves as a practical example of how to use the new impersonation features.

  • Updated the src/types/mod.rs to reflect the changes in the status code module, renaming it from status_code to status. This aligns with the new enum-based approach. [1] [2]

kreedzZhao pushed a commit to kreedzZhao/rnet that referenced this pull request Dec 8, 2025
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.

1 participant