Closed
Bug 1302213
Opened 8 years ago
Closed 5 years ago
Implement rust bindings for interacting with nsTArray
Categories
(Core :: XPCOM, defect, P3)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: nika, Unassigned)
References
(Blocks 1 open bug)
Details
nsTArray is used a lot, It would be nice to have a way to share the type to rust easily.
Updated•8 years ago
|
Priority: -- → P3
Comment 1•8 years ago
|
||
Transcript from talk about this bug with :manishearth on IRC (#content):
<qDot> Manishearth: How easy would it be to abstract the nsTArray bindings in stylo a bit to make a starter patch for bug 1302213?
<Manishearth> qDot: it's straightforward
<Manishearth> qDot: https://github.com/servo/servo/blob/master/components/style/gecko_bindings/sugar/ns_t_array.rs
<Manishearth> qDot: ah, one complication is that you don't have bindgen to get you the generated nsTArray struct
<Manishearth> you have to check it in manually
<Manishearth> you also need to move these two functions to somewhere else
<Manishearth> https://dxr.mozilla.org/mozilla-central/source/layout/style/ServoBindings.cpp#825
<Manishearth> ensuretarraycapacity and clearpodarray
<Manishearth> check out how the nsstring crate works
<Manishearth> fwiw mystor is aware of servo's nstarray bindings
<Manishearth> (they just didn't exist when that bug was filed)
Comment 2•6 years ago
|
||
This exists now in the form of https://crates.io/crates/thin-vec .
[dependencies.thin-vec]
version = "0.1.0"
features = ["gecko-ffi"]
It's not being used in mozilla-central yet.
Comment 3•5 years ago
|
||
Nika added support for reflecting XPIDL Array<T>
s into Rust ThinVec
s over in bug 1530467, and we have several crates using thin_vec
now—this can probably be closed.
You need to log in
before you can comment on or make changes to this bug.
Description
•