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: add id to RtcDataChannel bindings #3542

Closed
DougAnderson444 opened this issue Aug 2, 2023 · 3 comments · Fixed by #3547
Closed

feat: add id to RtcDataChannel bindings #3542

DougAnderson444 opened this issue Aug 2, 2023 · 3 comments · Fixed by #3547

Comments

@DougAnderson444
Copy link
Contributor

DougAnderson444 commented Aug 2, 2023

pub fn label(this: &RtcDataChannel) -> String;

I see label is here, could we also add the id property to RtcDataChannel ?

https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/id

@daxpedda
Copy link
Collaborator

daxpedda commented Aug 4, 2023

Yes, this is quite straightforward to accomplish, see the wasm-bindgen Book on how to do just that.
Let me know if you need any help.

@DougAnderson444
Copy link
Contributor Author

Excellent direction, thanks I'll do that.
I take it since the id is between 0 and 65,534 would be an unsigned long?

readonly attribute unsigned long id;

I didn't see the definition for the difference between unsigned long and unsigned short anywhere

@DougAnderson444
Copy link
Contributor Author

I figured out that unsigned short compiles to u16 which is the 65,534 we need

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 a pull request may close this issue.

2 participants