Skip to content

Commit

Permalink
deploy: 2a576c8
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Sep 16, 2024
1 parent dc62c79 commit 7ba7fa3
Show file tree
Hide file tree
Showing 97 changed files with 667 additions and 680 deletions.
4 changes: 2 additions & 2 deletions crates/doc/search-index.js

Large diffs are not rendered by default.

36 changes: 10 additions & 26 deletions crates/doc/src/wasmer_api/client.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@
<a href="#253" id="253">253</a>
<a href="#254" id="254">254</a>
<a href="#255" id="255">255</a>
<a href="#256" id="256">256</a>
<a href="#257" id="257">257</a>
<a href="#258" id="258">258</a>
<a href="#259" id="259">259</a>
<a href="#260" id="260">260</a>
<a href="#261" id="261">261</a>
<a href="#262" id="262">262</a>
<a href="#263" id="263">263</a>
</pre></div><pre class="rust"><code><span class="attr">#[cfg(not(target_family = <span class="string">&quot;wasm&quot;</span>))]
</span><span class="kw">use </span>std::time::Duration;

Expand Down Expand Up @@ -338,10 +330,14 @@
})
}

<span class="kw">pub fn </span>new(graphql_endpoint: Url, user_agent: <span class="kw-2">&amp;</span>str) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, anyhow::Error&gt; {
<span class="self">Self</span>::new_with_proxy(graphql_endpoint, user_agent, <span class="prelude-val">None</span>)
}

<span class="kw">pub fn </span>new_with_proxy(
graphql_endpoint: Url,
user_agent: <span class="kw-2">&amp;</span>str,
proxy: reqwest::Proxy,
proxy: <span class="prelude-ty">Option</span>&lt;reqwest::Proxy&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, anyhow::Error&gt; {
<span class="kw">let </span>builder = {
<span class="attr">#[cfg(all(target_arch = <span class="string">&quot;wasm32&quot;</span>, target_os = <span class="string">&quot;unknown&quot;</span>))]
Expand All @@ -352,30 +348,18 @@
.connect_timeout(Duration::from_secs(<span class="number">10</span>))
.timeout(Duration::from_secs(<span class="number">90</span>));

builder.proxy(proxy)
<span class="kw">if let </span><span class="prelude-val">Some</span>(proxy) = proxy {
builder.proxy(proxy)
} <span class="kw">else </span>{
builder
}
};

<span class="kw">let </span>client = builder.build().context(<span class="string">&quot;failed to create reqwest client&quot;</span>)<span class="question-mark">?</span>;

<span class="self">Self</span>::new_with_client(client, graphql_endpoint, user_agent)
}

<span class="kw">pub fn </span>new(graphql_endpoint: Url, user_agent: <span class="kw-2">&amp;</span>str) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, anyhow::Error&gt; {
<span class="attr">#[cfg(all(target_arch = <span class="string">&quot;wasm32&quot;</span>, target_os = <span class="string">&quot;unknown&quot;</span>))]
</span><span class="kw">let </span>client = reqwest::Client::builder()
.build()
.context(<span class="string">&quot;could not construct http client&quot;</span>)<span class="question-mark">?</span>;

<span class="attr">#[cfg(not(all(target_arch = <span class="string">&quot;wasm32&quot;</span>, target_os = <span class="string">&quot;unknown&quot;</span>)))]
</span><span class="kw">let </span>client = reqwest::Client::builder()
.connect_timeout(Duration::from_secs(<span class="number">10</span>))
.timeout(Duration::from_secs(<span class="number">90</span>))
.build()
.context(<span class="string">&quot;could not construct http client&quot;</span>)<span class="question-mark">?</span>;

<span class="self">Self</span>::new_with_client(client, graphql_endpoint, user_agent)
}

<span class="kw">pub fn </span>with_auth_token(<span class="kw-2">mut </span><span class="self">self</span>, auth_token: String) -&gt; <span class="self">Self </span>{
<span class="self">self</span>.auth_token = <span class="prelude-val">Some</span>(auth_token);
<span class="self">self
Expand Down
28 changes: 23 additions & 5 deletions crates/doc/src/wasmer_cli/commands/package/common/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
<a href="#234" id="234">234</a>
<a href="#235" id="235">235</a>
<a href="#236" id="236">236</a>
<a href="#237" id="237">237</a>
<a href="#238" id="238">238</a>
<a href="#239" id="239">239</a>
<a href="#240" id="240">240</a>
<a href="#241" id="241">241</a>
<a href="#242" id="242">242</a>
<a href="#243" id="243">243</a>
<a href="#244" id="244">244</a>
<a href="#245" id="245">245</a>
</pre></div><pre class="rust"><code><span class="kw">use crate</span>::{
commands::{AsyncCliCommand, Login},
config::WasmerEnv,
Expand Down Expand Up @@ -280,6 +289,7 @@
timeout: humantime::Duration,
package: <span class="kw-2">&amp;</span>Package,
pb: ProgressBar,
proxy: <span class="prelude-ty">Option</span>&lt;reqwest::Proxy&gt;,
) -&gt; anyhow::Result&lt;String&gt; {
<span class="kw">let </span>hash_str = hash.to_string();
<span class="kw">let </span>hash_str = hash_str.trim_start_matches(<span class="string">&quot;sha256:&quot;</span>);
Expand All @@ -304,11 +314,19 @@

<span class="macro">tracing::info!</span>(<span class="string">&quot;signed url is: {session_uri}&quot;</span>);

<span class="kw">let </span>client = reqwest::Client::builder()
.default_headers(reqwest::header::HeaderMap::default())
.timeout(timeout.into())
.build()
.unwrap();
<span class="kw">let </span>client = {
<span class="kw">let </span>builder = reqwest::Client::builder()
.default_headers(reqwest::header::HeaderMap::default())
.timeout(timeout.into());

<span class="kw">let </span>builder = <span class="kw">if let </span><span class="prelude-val">Some</span>(proxy) = proxy {
builder.proxy(proxy)
} <span class="kw">else </span>{
builder
};

builder.build().unwrap()
};

<span class="kw">let </span>res = client
.post(<span class="kw-2">&amp;</span>session_uri)
Expand Down
28 changes: 2 additions & 26 deletions crates/doc/src/wasmer_cli/commands/package/download.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,26 +305,13 @@
<a href="#305" id="305">305</a>
<a href="#306" id="306">306</a>
<a href="#307" id="307">307</a>
<a href="#308" id="308">308</a>
<a href="#309" id="309">309</a>
<a href="#310" id="310">310</a>
<a href="#311" id="311">311</a>
<a href="#312" id="312">312</a>
<a href="#313" id="313">313</a>
<a href="#314" id="314">314</a>
<a href="#315" id="315">315</a>
<a href="#316" id="316">316</a>
<a href="#317" id="317">317</a>
<a href="#318" id="318">318</a>
<a href="#319" id="319">319</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{env::current_dir, path::PathBuf};

<span class="kw">use </span>anyhow::{bail, Context};
<span class="kw">use </span>dialoguer::console::{style, Emoji};
<span class="kw">use </span>indicatif::{ProgressBar, ProgressStyle};
<span class="kw">use </span>tempfile::NamedTempFile;
<span class="kw">use </span>wasmer_config::package::{PackageIdent, PackageSource};
<span class="kw">use </span>wasmer_wasix::http::reqwest::get_proxy;

<span class="kw">use </span><span class="kw">crate</span>::config::WasmerEnv;

Expand All @@ -347,10 +334,6 @@
</span><span class="attr">#[clap(long)]
</span><span class="kw">pub </span>quiet: bool,

<span class="doccomment">/// proxy to use for downloading
</span><span class="attr">#[clap(long)]
</span><span class="kw">pub </span>proxy: <span class="prelude-ty">Option</span>&lt;String&gt;,

<span class="doccomment">/// The package to download.
</span>package: PackageSource,
}
Expand Down Expand Up @@ -420,13 +403,7 @@
<span class="comment">// caveat: client_unauthennticated will use a token if provided, it
// just won&#39;t fail if none is present. So, _unauthenticated() can actually
// produce an authenticated client.
</span><span class="kw">let </span>client = <span class="kw">if let </span><span class="prelude-val">Some</span>(proxy) = <span class="kw-2">&amp;</span><span class="self">self</span>.proxy {
<span class="kw">let </span>proxy = reqwest::Proxy::all(proxy)<span class="question-mark">?</span>;

<span class="self">self</span>.env.client_unauthennticated_with_proxy(proxy)<span class="question-mark">?
</span>} <span class="kw">else </span>{
<span class="self">self</span>.env.client_unauthennticated()<span class="question-mark">?
</span>};
</span><span class="kw">let </span>client = <span class="self">self</span>.env.client_unauthennticated()<span class="question-mark">?</span>;

<span class="kw">let </span>version = id.version_or_default().to_string();
<span class="kw">let </span>version = <span class="kw">if </span>version == <span class="string">&quot;*&quot; </span>{
Expand Down Expand Up @@ -490,7 +467,7 @@

<span class="kw">let </span>builder = {
<span class="kw">let </span><span class="kw-2">mut </span>builder = reqwest::blocking::ClientBuilder::new();
<span class="kw">if let </span><span class="prelude-val">Some</span>(proxy) = get_proxy()<span class="question-mark">? </span>{
<span class="kw">if let </span><span class="prelude-val">Some</span>(proxy) = <span class="self">self</span>.env.proxy()<span class="question-mark">? </span>{
builder = builder.proxy(proxy);
}
builder
Expand Down Expand Up @@ -628,7 +605,6 @@
out_path: <span class="prelude-val">Some</span>(out_path.clone()),
package: <span class="string">&quot;wasmer/hello@0.1.0&quot;</span>.parse().unwrap(),
quiet: <span class="bool-val">true</span>,
proxy: <span class="prelude-val">None</span>,
};

cmd.execute().unwrap();
Expand Down
18 changes: 17 additions & 1 deletion crates/doc/src/wasmer_cli/commands/package/push.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@
<a href="#258" id="258">258</a>
<a href="#259" id="259">259</a>
<a href="#260" id="260">260</a>
<a href="#261" id="261">261</a>
<a href="#262" id="262">262</a>
<a href="#263" id="263">263</a>
<a href="#264" id="264">264</a>
<a href="#265" id="265">265</a>
<a href="#266" id="266">266</a>
<a href="#267" id="267">267</a>
<a href="#268" id="268">268</a>
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">super</span>::common::{macros::<span class="kw-2">*</span>, <span class="kw-2">*</span>};
<span class="kw">use crate</span>::{
commands::{AsyncCliCommand, PackageBuild},
Expand Down Expand Up @@ -388,7 +396,15 @@
) -&gt; anyhow::Result&lt;()&gt; {
<span class="kw">let </span>pb = <span class="macro">make_spinner!</span>(<span class="self">self</span>.quiet, <span class="string">&quot;Uploading the package..&quot;</span>);

<span class="kw">let </span>signed_url = upload(client, package_hash, <span class="self">self</span>.timeout, package, pb.clone()).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>signed_url = upload(
client,
package_hash,
<span class="self">self</span>.timeout,
package,
pb.clone(),
<span class="self">self</span>.env.proxy()<span class="question-mark">?</span>,
)
.<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">spinner_ok!</span>(pb, <span class="string">&quot;Package correctly uploaded&quot;</span>);

<span class="kw">let </span>pb = <span class="macro">make_spinner!</span>(<span class="self">self</span>.quiet, <span class="string">&quot;Waiting for package to become available...&quot;</span>);
Expand Down
28 changes: 12 additions & 16 deletions crates/doc/src/wasmer_cli/config/env.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@
<a href="#363" id="363">363</a>
<a href="#364" id="364">364</a>
<a href="#365" id="365">365</a>
<a href="#366" id="366">366</a>
<a href="#367" id="367">367</a>
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">super</span>::WasmerConfig;
<span class="kw">use </span>anyhow::{Context, Error};
<span class="kw">use </span>lazy_static::lazy_static;
Expand Down Expand Up @@ -458,6 +456,17 @@
})
}

<span class="doccomment">/// Returns the proxy specified in wasmer config if present
</span><span class="kw">pub fn </span>proxy(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="prelude-ty">Option</span>&lt;reqwest::Proxy&gt;, Error&gt; {
<span class="self">self</span>.config()<span class="question-mark">?
</span>.proxy
.url
.as_ref()
.map(reqwest::Proxy::all)
.transpose()
.map_err(Into::into)
}

<span class="doccomment">/// The directory all Wasmer artifacts are stored in.
</span><span class="kw">pub fn </span>dir(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="kw-2">&amp;</span>Path {
<span class="kw-2">&amp;</span><span class="self">self</span>.wasmer_dir
Expand Down Expand Up @@ -494,22 +503,9 @@

<span class="kw">pub fn </span>client_unauthennticated(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;WasmerClient, anyhow::Error&gt; {
<span class="kw">let </span>registry_url = <span class="self">self</span>.registry_endpoint()<span class="question-mark">?</span>;
<span class="kw">let </span>client = wasmer_api::WasmerClient::new(registry_url, <span class="kw-2">&amp;</span>DEFAULT_WASMER_CLI_USER_AGENT)<span class="question-mark">?</span>;

<span class="kw">let </span>client = <span class="kw">if let </span><span class="prelude-val">Some</span>(token) = <span class="self">self</span>.token() {
client.with_auth_token(token)
} <span class="kw">else </span>{
client
};
<span class="kw">let </span>proxy = <span class="self">self</span>.proxy()<span class="question-mark">?</span>;

<span class="prelude-val">Ok</span>(client)
}

<span class="kw">pub fn </span>client_unauthennticated_with_proxy(
<span class="kw-2">&amp;</span><span class="self">self</span>,
proxy: reqwest::Proxy,
) -&gt; <span class="prelude-ty">Result</span>&lt;WasmerClient, anyhow::Error&gt; {
<span class="kw">let </span>registry_url = <span class="self">self</span>.registry_endpoint()<span class="question-mark">?</span>;
<span class="kw">let </span>client = wasmer_api::WasmerClient::new_with_proxy(
registry_url,
<span class="kw-2">&amp;</span>DEFAULT_WASMER_CLI_USER_AGENT,
Expand Down
2 changes: 1 addition & 1 deletion crates/doc/wasmer/engine/trait.CompilerConfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
<p>NaN canonicalization is useful when trying to run WebAssembly
deterministically across different architectures.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.default_features_for_target" class="method"><h4 class="code-header">fn <a href="#method.default_features_for_target" class="fn">default_features_for_target</a>(&amp;self, _target: &amp;<a class="struct" href="../struct.Target.html" title="struct wasmer::Target">Target</a>) -&gt; <a class="struct" href="../sys/struct.Features.html" title="struct wasmer::sys::Features">Features</a></h4></section></summary><div class="docblock"><p>Gets the default features for this compiler in the given target</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-CompilerConfig-for-Cranelift" class="impl"><a class="src rightside" href="../../src/wasmer_compiler_cranelift/config.rs.html#203">source</a><a href="#impl-CompilerConfig-for-Cranelift" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../sys/trait.CompilerConfig.html" title="trait wasmer::sys::CompilerConfig">CompilerConfig</a> for <a class="struct" href="../sys/struct.Cranelift.html" title="struct wasmer::sys::Cranelift">Cranelift</a></h3></section><section id="impl-CompilerConfig-for-LLVM" class="impl"><a class="src rightside" href="../../src/wasmer_compiler_llvm/config.rs.html#249">source</a><a href="#impl-CompilerConfig-for-LLVM" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../sys/trait.CompilerConfig.html" title="trait wasmer::sys::CompilerConfig">CompilerConfig</a> for <a class="struct" href="../sys/struct.LLVM.html" title="struct wasmer::sys::LLVM">LLVM</a></h3></section><section id="impl-CompilerConfig-for-Singlepass" class="impl"><a href="#impl-CompilerConfig-for-Singlepass" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../sys/trait.CompilerConfig.html" title="trait wasmer::sys::CompilerConfig">CompilerConfig</a> for <a class="struct" href="../sys/struct.Singlepass.html" title="struct wasmer::sys::Singlepass">Singlepass</a></h3></section></div><script src="../../implementors/wasmer_compiler/compiler/trait.CompilerConfig.js" data-ignore-extern-crates="wasmer_compiler_llvm,wasmer_compiler_singlepass,wasmer_compiler_cranelift" async></script></section></div></main></body></html>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-CompilerConfig-for-Cranelift" class="impl"><a class="src rightside" href="../../src/wasmer_compiler_cranelift/config.rs.html#203">source</a><a href="#impl-CompilerConfig-for-Cranelift" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../sys/trait.CompilerConfig.html" title="trait wasmer::sys::CompilerConfig">CompilerConfig</a> for <a class="struct" href="../sys/struct.Cranelift.html" title="struct wasmer::sys::Cranelift">Cranelift</a></h3></section><section id="impl-CompilerConfig-for-LLVM" class="impl"><a href="#impl-CompilerConfig-for-LLVM" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../sys/trait.CompilerConfig.html" title="trait wasmer::sys::CompilerConfig">CompilerConfig</a> for <a class="struct" href="../sys/struct.LLVM.html" title="struct wasmer::sys::LLVM">LLVM</a></h3></section><section id="impl-CompilerConfig-for-Singlepass" class="impl"><a href="#impl-CompilerConfig-for-Singlepass" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../sys/trait.CompilerConfig.html" title="trait wasmer::sys::CompilerConfig">CompilerConfig</a> for <a class="struct" href="../sys/struct.Singlepass.html" title="struct wasmer::sys::Singlepass">Singlepass</a></h3></section></div><script src="../../implementors/wasmer_compiler/compiler/trait.CompilerConfig.js" data-ignore-extern-crates="wasmer_compiler_llvm,wasmer_compiler_singlepass,wasmer_compiler_cranelift" async></script></section></div></main></body></html>
2 changes: 1 addition & 1 deletion crates/doc/wasmer/sys/engine/struct.Engine.html

Large diffs are not rendered by default.

Loading

0 comments on commit 7ba7fa3

Please sign in to comment.