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

Expose a way to create a Loop from a uv_loop_t #2

Open
noib3 opened this issue Aug 1, 2022 · 1 comment
Open

Expose a way to create a Loop from a uv_loop_t #2

noib3 opened this issue Aug 1, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@noib3
Copy link

noib3 commented Aug 1, 2022

Hi, is it possible to add a method on Loop that does the equivalent of the private FromInner trait? I need to create a Loop from a uv_loop_t. Would it be possible to also make that function const?

@bmatcuk bmatcuk self-assigned this Sep 4, 2022
@bmatcuk bmatcuk added the enhancement New feature or request label Sep 4, 2022
@bmatcuk
Copy link
Owner

bmatcuk commented Sep 4, 2022

Hmm, seems possible, but I'd caution against it. libuv-rs uses the loop's data to track some stuff - using a uv_loop that was created outside of libuv-rs could cause a segfault if used incorrectly. If I added this feature, I'd probably mark it unsafe. Is that acceptable?

Where is this uv_loop handle coming from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants