Skip to content

Commit e844c0b

Browse files
committed
Add viaduct-hyper to the iOS megazord
The goal is to move iOS to viaduct-hyper, which implements the new viaduct backend. This is the step 1. Next up is switching firefox-ios to initializing `hyper` rather than `reqwest`. The last step is removing `viaduct-reqwest` from the megazord.
1 parent b841433 commit e844c0b

File tree

6 files changed

+12
-1
lines changed

6 files changed

+12
-1
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/support/viaduct-hyper/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ struct HyperBackend {
3030
}
3131

3232
/// Set the viaduct backend to the `hyper`-based one with HTTPS support.
33+
///
34+
/// Named `viaduct_init_backend_hyper` since that reads better on iOS/Swift where there aren't any
35+
/// namespaces. Once we move to UniFII 0.31 we can use the renaming feature to do this instead.
3336
#[uniffi::export]
34-
pub fn init_backend_hyper() -> Result<()> {
37+
pub fn viaduct_init_backend_hyper() -> Result<()> {
3538
info!("initializing hyper backend");
3639
// Create a multi-threaded runtime, with 1 worker thread.
3740
//
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[bindings.swift]
2+
ffi_module_name = "MozillaRustComponents"
3+
ffi_module_filename = "viaducthyperFFI"

megazords/ios-rust/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ crate-type = ["staticlib", "rlib"]
1111
[dependencies]
1212
rust-log-forwarder = { path = "../../components/support/rust-log-forwarder" }
1313
viaduct = { path = "../../components/viaduct", features = ["ohttp"] }
14+
viaduct-hyper = { path = "../../components/support/viaduct-hyper" }
1415
viaduct-reqwest = { path = "../../components/support/viaduct-reqwest" }
1516
nimbus-sdk = { path = "../../components/nimbus" }
1617
crashtest = { path = "../../components/crashtest" }

megazords/ios-rust/focus/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ crate-type = ["staticlib"]
1111
[dependencies]
1212
rust-log-forwarder = { path = "../../../components/support/rust-log-forwarder" }
1313
viaduct = { path = "../../../components/viaduct" }
14+
viaduct-hyper = { path = "../../../components/support/viaduct-hyper" }
1415
viaduct-reqwest = { path = "../../../components/support/viaduct-reqwest" }
1516
nimbus-sdk = { path = "../../../components/nimbus" }
1617
error-support = { path = "../../../components/support/error" }

megazords/ios-rust/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ pub use sync_manager;
2828
pub use tabs;
2929
pub use tracing_support;
3030
pub use viaduct;
31+
pub use viaduct_hyper;
3132
pub use viaduct_reqwest;

0 commit comments

Comments
 (0)