Skip to content

Commit

Permalink
Built artifacts of f3f7ccc [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
mhammond committed Jan 12, 2024
1 parent a8c47b2 commit e6c6288
Show file tree
Hide file tree
Showing 42 changed files with 112 additions and 99 deletions.
4 changes: 2 additions & 2 deletions internals/api/search-index.js

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions internals/api/src/uniffi_bindgen/interface/enum_.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,16 @@
<a href="#750" id="750">750</a>
<a href="#751" id="751">751</a>
<a href="#752" id="752">752</a>
<a href="#753" id="753">753</a>
<a href="#754" id="754">754</a>
<a href="#755" id="755">755</a>
<a href="#756" id="756">756</a>
<a href="#757" id="757">757</a>
<a href="#758" id="758">758</a>
<a href="#759" id="759">759</a>
<a href="#760" id="760">760</a>
<a href="#761" id="761">761</a>
<a href="#762" id="762">762</a>
</pre></div><pre class="rust"><code><span class="comment">/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Expand Down Expand Up @@ -846,7 +856,9 @@
//!
//! ```
//! # let ci = uniffi_bindgen::interface::ComponentInterface::from_webidl(r##&quot;
//! # namespace example {};
//! # namespace example {
//! # [Throws=Example] void func();
//! # };
//! # [Error]
//! # enum Example {
//! # &quot;one&quot;,
Expand Down Expand Up @@ -882,7 +894,9 @@
//!
//! ```
//! # let ci = uniffi_bindgen::interface::ComponentInterface::from_webidl(r##&quot;
//! # namespace example {};
//! # namespace example {
//! # [Throws=Example] void func();
//! # };
//! # [Error]
//! # interface Example {
//! # one();
Expand Down Expand Up @@ -1248,7 +1262,10 @@
</span><span class="attr">#[test]
</span><span class="kw">fn </span>test_variants() {
<span class="kw">const </span>UDL: <span class="kw-2">&amp;</span>str = <span class="string">r#&quot;
namespace test{};
namespace test{
[Throws=Testing]
void func();
};
[Error]
enum Testing { &quot;one&quot;, &quot;two&quot;, &quot;three&quot; };
&quot;#</span>;
Expand Down Expand Up @@ -1287,7 +1304,10 @@
<span class="attr">#[test]
</span><span class="kw">fn </span>test_variant_data() {
<span class="kw">const </span>UDL: <span class="kw-2">&amp;</span>str = <span class="string">r#&quot;
namespace test{};
namespace test{
[Throws=Testing]
void func();
};

[Error]
interface Testing {
Expand Down
20 changes: 16 additions & 4 deletions internals/api/src/uniffi_bindgen/interface/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,12 @@
<a href="#1233" id="1233">1233</a>
<a href="#1234" id="1234">1234</a>
<a href="#1235" id="1235">1235</a>
<a href="#1236" id="1236">1236</a>
<a href="#1237" id="1237">1237</a>
<a href="#1238" id="1238">1238</a>
<a href="#1239" id="1239">1239</a>
<a href="#1240" id="1240">1240</a>
<a href="#1241" id="1241">1241</a>
</pre></div><pre class="rust"><code><span class="comment">/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Expand Down Expand Up @@ -2005,6 +2011,8 @@
<span class="macro">bail!</span>(<span class="string">&quot;Conflicting type definition for \&quot;{}\&quot;&quot;</span>, defn.name());
}
<span class="self">self</span>.types.add_known_types(defn.iter_types())<span class="question-mark">?</span>;
defn.throws_name()
.map(|n| <span class="self">self</span>.errors.insert(n.to_string()));
<span class="self">self</span>.functions.push(defn);

<span class="prelude-val">Ok</span>(())
Expand All @@ -2016,6 +2024,8 @@
<span class="kw">let </span>defn: Constructor = meta.into();

<span class="self">self</span>.types.add_known_types(defn.iter_types())<span class="question-mark">?</span>;
defn.throws_name()
.map(|n| <span class="self">self</span>.errors.insert(n.to_string()));
object.constructors.push(defn);

<span class="prelude-val">Ok</span>(())
Expand All @@ -2027,6 +2037,9 @@
.ok_or_else(|| <span class="macro">anyhow!</span>(<span class="string">&quot;add_method_meta: object {} not found&quot;</span>, <span class="kw-2">&amp;</span>method.object_name))<span class="question-mark">?</span>;

<span class="self">self</span>.types.add_known_types(method.iter_types())<span class="question-mark">?</span>;
method
.throws_name()
.map(|n| <span class="self">self</span>.errors.insert(n.to_string()));
method.object_impl = object.imp;
object.methods.push(method);
<span class="prelude-val">Ok</span>(())
Expand All @@ -2052,10 +2065,6 @@
<span class="prelude-val">Ok</span>(())
}

<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>note_name_used_as_error(<span class="kw-2">&amp;mut </span><span class="self">self</span>, name: <span class="kw-2">&amp;</span>str) {
<span class="self">self</span>.errors.insert(name.to_string());
}

<span class="kw">pub fn </span>is_name_used_as_error(<span class="kw-2">&amp;</span><span class="self">self</span>, name: <span class="kw-2">&amp;</span>str) -&gt; bool {
<span class="self">self</span>.errors.contains(name)
}
Expand Down Expand Up @@ -2083,6 +2092,9 @@
<span class="self">self</span>.callback_interface_throws_types.insert(error.clone());
}
<span class="self">self</span>.types.add_known_types(method.iter_types())<span class="question-mark">?</span>;
method
.throws_name()
.map(|n| <span class="self">self</span>.errors.insert(n.to_string()));
cbi.methods.push(method);
} <span class="kw">else </span>{
<span class="self">self</span>.add_method_meta(meta)<span class="question-mark">?</span>;
Expand Down
24 changes: 4 additions & 20 deletions internals/api/src/uniffi_bindgen/macro_metadata/ci.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,13 @@
<a href="#132" id="132">132</a>
<a href="#133" id="133">133</a>
<a href="#134" id="134">134</a>
<a href="#135" id="135">135</a>
<a href="#136" id="136">136</a>
<a href="#137" id="137">137</a>
<a href="#138" id="138">138</a>
<a href="#139" id="139">139</a>
<a href="#140" id="140">140</a>
<a href="#141" id="141">141</a>
<a href="#142" id="142">142</a>
</pre></div><pre class="rust"><code><span class="comment">/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

</span><span class="kw">use </span><span class="kw">crate</span>::interface::{CallbackInterface, ComponentInterface, Enum, Record, Type};
<span class="kw">use </span>anyhow::{bail, Context};
<span class="kw">use </span>uniffi_meta::{
create_metadata_groups, group_metadata, EnumMetadata, ErrorMetadata, Metadata, MetadataGroup,
};
<span class="kw">use </span>uniffi_meta::{create_metadata_groups, group_metadata, EnumMetadata, Metadata, MetadataGroup};

<span class="doccomment">/// Add Metadata items to the ComponentInterface
///
Expand Down Expand Up @@ -240,7 +230,9 @@
iface.add_record_definition(record)<span class="question-mark">?</span>;
}
Metadata::Enum(meta) =&gt; {
<span class="kw">let </span>flat = meta.variants.iter().all(|v| v.fields.is_empty());
<span class="kw">let </span>flat = meta
.forced_flatness
.unwrap_or_else(|| meta.variants.iter().all(|v| v.fields.is_empty()));
add_enum_to_ci(iface, meta, flat)<span class="question-mark">?</span>;
}
Metadata::Object(meta) =&gt; {
Expand All @@ -264,14 +256,6 @@
Metadata::TraitMethod(meta) =&gt; {
iface.add_trait_method_meta(meta)<span class="question-mark">?</span>;
}
Metadata::Error(meta) =&gt; {
iface.note_name_used_as_error(meta.name());
<span class="kw">match </span>meta {
ErrorMetadata::Enum { enum_, is_flat } =&gt; {
add_enum_to_ci(iface, enum_, is_flat)<span class="question-mark">?</span>;
}
};
}
Metadata::CustomType(meta) =&gt; {
iface.types.add_known_type(<span class="kw-2">&amp;</span>Type::Custom {
module_path: meta.module_path.clone(),
Expand Down
4 changes: 3 additions & 1 deletion internals/api/src/uniffi_macros/enum_.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
<a href="#298" id="298">298</a>
<a href="#299" id="299">299</a>
<a href="#300" id="300">300</a>
<a href="#301" id="301">301</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>proc_macro2::{Ident, Span, TokenStream};
<span class="kw">use </span>quote::quote;
<span class="kw">use </span>syn::{
Expand Down Expand Up @@ -480,7 +481,8 @@
::uniffi::MetadataBuffer::from_code(::uniffi::metadata::codes::ENUM)
.concat_str(#module_path)
.concat_str(#name)
};
.concat_option_bool(<span class="prelude-val">None</span>) <span class="comment">// forced_flatness
</span>};
metadata_expr.extend(variant_metadata(enum_)<span class="question-mark">?</span>);
metadata_expr.extend(<span class="macro">quote! </span>{
.concat_bool(#non_exhaustive)
Expand Down
10 changes: 3 additions & 7 deletions internals/api/src/uniffi_macros/error.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@
<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>
</pre></div><pre class="rust"><code><span class="kw">use </span>proc_macro2::{Ident, Span, TokenStream};
<span class="kw">use </span>quote::quote;
<span class="kw">use </span>syn::{
Expand Down Expand Up @@ -520,12 +518,10 @@
<span class="kw">let </span>flat = attr.flat.is_some();
<span class="kw">let </span>non_exhaustive = attr.non_exhaustive.is_some();
<span class="kw">let </span><span class="kw-2">mut </span>metadata_expr = <span class="macro">quote! </span>{
::uniffi::MetadataBuffer::from_code(::uniffi::metadata::codes::ERROR)
<span class="comment">// first our is-flat flag
</span>.concat_bool(#flat)
<span class="comment">// followed by an enum
</span>.concat_str(#module_path)
::uniffi::MetadataBuffer::from_code(::uniffi::metadata::codes::ENUM)
.concat_str(#module_path)
.concat_str(#name)
.concat_option_bool(<span class="prelude-val">Some</span>(#flat))
};
<span class="kw">if </span>flat {
metadata_expr.extend(flat_error_variant_metadata(enum_)<span class="question-mark">?</span>)
Expand Down
2 changes: 1 addition & 1 deletion internals/api/uniffi/all.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion internals/api/uniffi/metadata/codes/constant.ERROR.html

This file was deleted.

Loading

0 comments on commit e6c6288

Please sign in to comment.