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

feat: improving async and sync API #54

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

sabify
Copy link

@sabify sabify commented Jan 2, 2023

This pull request will remove the requirement for obtaining an unnecessary mutable reference to self in AsyncRead and AsyncWrite, as it is already protected by locks within the code. It will also include methods like send and recv in the async API that can be used concurrently by only sharing a reference to the queue.

The method queue will be replaced by queue_mut, as it is intended to be. Additionally, two more methods will be added: queue, which returns a reference to the queue, and queues, which transmute the device to the vector of its queues.

@sabify sabify changed the title fix: relaxing the mutable ref required in AsyncRead and AsyncWrite feat: improving async and sync API Jan 8, 2023
@mtnking
Copy link

mtnking commented Mar 3, 2023

This conceptually would resolve a lot of issues for me that currently require extensive work-arounds.

@GyulyVGC
Copy link

GyulyVGC commented Jan 4, 2024

Seems a clean solution and it'd be really helpful also in my case @sabify

Do you know by chance if (and how) is possible to access the AsyncQueues given an AsyncDevice with the current crate API?

feifeigood pushed a commit to feifeigood/rust-tun that referenced this pull request Jun 12, 2024
* update example

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* add set_tun_name for freebsd

* add set_tun_name for freebsd

* unify the access of internal api

* update freebsd

* update example

* cargo fmt

* cargo fmt
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.

3 participants