Re: [dev-servo] Regarding CSC 517 OSS project

2019-04-26 Thread Niveditha Shankar
Hi Josh, We tried to run servo with our modified devices crate. Now we are getting the following errors, error[E0277]: the size for values of type `(dyn device::adapter::BluetoothAdapter + 'static)` cannot be known at compilation time --> components/bluetooth/lib.rs:193:5 | 193 | a

Re: [dev-servo] Regarding CSC 517 OSS project

2019-04-01 Thread Niveditha Shankar
Thanks for clarifying the doubt! We were doing exactly this but did not know how to access the respective properties under BluetoothAdapter. Now we get it! -Niveditha Shankar On Mon, Apr 1, 2019 at 10:23 AM Josh Bowman-Matthews wrote: > Previously we had an enum > (https://doc.rust-lang.org/boo

Re: [dev-servo] Regarding CSC 517 OSS project

2019-04-01 Thread Josh Bowman-Matthews
Previously we had an enum (https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html) like this: enum BluetoothAdapter { Bluez(Arc), Android(Arc), } The Bluez, Android, etc. names gave us variants to refer to, with the real type stored inside. We should now be able to define somethin

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-31 Thread Niveditha Shankar
Could you please brief us a little on "Bluez(Arc), Android(Arc)... " so that we can get an idea of how they should be declared in trait. Since the implementation has to be per platform, I understand that the function calls for say, get_id() should be direct like - bluez.get_id(). It would be helpf

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-31 Thread Josh Bowman-Matthews
The devices crate is a crates.io dependency rather than a github one, since we publish new changes to crates.io. That means adding an entry to the existing [patch.crates-io] category instead of creating a new category for the github repository. On 3/31/19 6:56 PM, Niveditha Shankar wrote: Tha

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-31 Thread Niveditha Shankar
Thank you , I will look into it and see if I can fix them. We referred to the links you sent us on overriding dependancies and tried them. We are unable to run it. We get the error *error:* failed to resolve patches for `https://github.com/servo/devices` Caused by: patch for `devices` in `ht

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-31 Thread Josh Bowman-Matthews
Those errors are difficult to diagnose without seeing the rest of the code. However, given that BluetoothAdapter is supposed to be a trait now, the second function does not look like it is using trait objects correctly. As for the first function, the error message appears to be describing a con

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-31 Thread Niveditha Shankar
Hello Josh We are trying to fix the errors we got in adapter.rs. We fixed most of them. The errors that are left are due to the changes we made to the init functions. We are not sure about the following errors, could you help us with this? error[E0407]: method `get_modalias` is not a member of t

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-30 Thread Niveditha Shankar
We meant to ask if code in https://github.com/servo/devices/blob/d6c62e0873b2ec9a68c97a3370667e8b9a879cf4/src/bluetooth.rs#L276-L305 should be split and the functions corresponding to say linux should be put in the structure we created for implementing BluetoothAdapter for linux. For example, pub

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-30 Thread Josh Bowman-Matthews
Yes - use a Cargo override to build Servo with your local modified version of the devices crate. You can read more about overrides at https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overriding-dependencies and https://doc.rust-lang.org/cargo/reference/manifest.html#the-pa

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-30 Thread Niveditha Shankar
Okay I think I get it. Thank you! Is there anyway I can check if the changes I make to the devices crate is right? Our submission is on Monday and we are going to continue working with Webbluetooth for our final project too. So if our implementation of our adapter.rs file is right, we can go ahe

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-30 Thread Josh Bowman-Matthews
The init functions are actually a bit special, because they can't be turned into static methods on the new trait without running into compile errors. I recommend doing this instead: trait BluetoothAdapter { // ... } impl BluetoothAdapter { #[cfg(all(target_os = "macos", feature = "bluetoo

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-30 Thread Niveditha Shankar
Thank you! We meant to ask if code in https://github.com/servo/devices/blob/d6c62e0873b2ec9a68c97a3370667e8b9a879cf4/src/bluetooth.rs#L276-L305 should be split and the functions corresponding to say linux should be put in the structure we created for implementing BluetoothAdapter for linux. Sincer

Re: [dev-servo] Regarding CSC 517 OSS project

2019-03-29 Thread Josh Bowman-Matthews
That sounds like the right idea. I'm not quite sure what this question is asking, however: > Are we right in assuming that the current BluetoothAdapter function has to > be broken for each component and put in the respective structure? If you are asking if code like https://github.com/servo/