Skip to content

Commit

Permalink
Built artifacts of 903b0b8 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
bendk committed May 6, 2024
1 parent 620150f commit 5f829ac
Show file tree
Hide file tree
Showing 51 changed files with 133 additions and 66 deletions.
4 changes: 2 additions & 2 deletions internals/api/search-index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/src/uniffi_macros/error.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">let </span>lower_impl_spec = options.ffi_impl_header(<span class="string">"Lower"</span>, ident);
<span class="kw">let </span>lift_impl_spec = options.ffi_impl_header(<span class="string">"Lift"</span>, ident);
<span class="kw">let </span>type_id_impl_spec = options.ffi_impl_header(<span class="string">"TypeId"</span>, ident);
<span class="kw">let </span>derive_ffi_traits = options.derive_ffi_traits(ident, <span class="kw-2">&amp;</span>[<span class="string">"ConvertError"</span>]);
<span class="kw">let </span>derive_ffi_traits = options.derive_ffi_traits(ident, <span class="kw-2">&amp;</span>[<span class="string">"LowerError"</span>, <span class="string">"ConvertError"</span>]);
<span class="kw">let </span>mod_path = <span class="kw">match </span>mod_path() {
<span class="prelude-val">Ok</span>(p) =&gt; p,
<span class="prelude-val">Err</span>(e) =&gt; <span class="kw">return </span>e.into_compile_error(),
Expand Down
14 changes: 14 additions & 0 deletions internals/api/src/uniffi_macros/ffiops.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#113" id="113">113</a>
<a href="#114" id="114">114</a>
<a href="#115" id="115">115</a>
<a href="#116" id="116">116</a>
<a href="#117" id="117">117</a>
<a href="#118" id="118">118</a>
<a href="#119" id="119">119</a>
<a href="#120" id="120">120</a>
<a href="#121" id="121">121</a>
<a href="#122" id="122">122</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 @@ -184,6 +191,13 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}
}

<span class="doccomment">/// Lower error function
</span><span class="kw">pub fn </span>lower_error(ty: <span class="kw">impl </span>ToTokens) -&gt; TokenStream {
<span class="macro">quote! </span>{
&lt;#ty <span class="kw">as </span>::uniffi::LowerError&lt;<span class="kw">crate</span>::UniFfiTag&gt;&gt;::lower_error
}
}

<span class="doccomment">/// Lift return type
</span><span class="kw">pub fn </span>lift_return_type(ty: <span class="kw">impl </span>ToTokens) -&gt; TokenStream {
<span class="macro">quote! </span>{
Expand Down
36 changes: 26 additions & 10 deletions internals/api/src/uniffi_macros/object.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#221" id="221">221</a>
<a href="#222" id="222">222</a>
<a href="#223" id="223">223</a>
<a href="#224" id="224">224</a>
<a href="#225" id="225">225</a>
<a href="#226" id="226">226</a>
<a href="#227" id="227">227</a>
<a href="#228" id="228">228</a>
<a href="#229" id="229">229</a>
<a href="#230" id="230">230</a>
<a href="#231" id="231">231</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::DeriveInput;
Expand Down Expand Up @@ -324,18 +332,20 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">let </span>ident = object.ident();
<span class="kw">let </span>impl_spec = options.ffi_impl_header(<span class="string">"FfiConverterArc"</span>, ident);
<span class="kw">let </span>lower_return_impl_spec = options.ffi_impl_header(<span class="string">"LowerReturn"</span>, ident);
<span class="kw">let </span>lower_error_impl_spec = options.ffi_impl_header(<span class="string">"LowerError"</span>, ident);
<span class="kw">let </span>type_id_impl_spec = options.ffi_impl_header(<span class="string">"TypeId"</span>, ident);
<span class="kw">let </span>lift_ref_impl_spec = options.ffi_impl_header(<span class="string">"LiftRef"</span>, ident);
<span class="kw">let </span>mod_path = <span class="kw">match </span>mod_path() {
<span class="prelude-val">Ok</span>(p) =&gt; p,
<span class="prelude-val">Err</span>(e) =&gt; <span class="kw">return </span>e.into_compile_error(),
};
<span class="kw">let </span>arc_self_type = <span class="macro">quote! </span>{ ::std::sync::Arc&lt;<span class="self">Self</span>&gt; };
<span class="kw">let </span>lower = ffiops::lower(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>type_id_meta = ffiops::type_id_meta(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>try_lift = ffiops::try_lift(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>lower_return_type = ffiops::lower_return_type(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>lower_return = ffiops::lower_return(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>lower_arc = ffiops::lower(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>type_id_meta_arc = ffiops::type_id_meta(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>try_lift_arc = ffiops::try_lift(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>lower_return_type_arc = ffiops::lower_return_type(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>lower_return_arc = ffiops::lower_return(<span class="kw-2">&amp;</span>arc_self_type);
<span class="kw">let </span>lower_error_arc = ffiops::lower_error(<span class="kw-2">&amp;</span>arc_self_type);

<span class="macro">quote! </span>{
<span class="comment">// All Object structs must be `Sync + Send`. The generated scaffolding will fail to compile
Expand Down Expand Up @@ -384,7 +394,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
/// function for other types may lead to undefined behaviour.
</span><span class="kw">fn </span>write(obj: ::std::sync::Arc&lt;<span class="self">Self</span>&gt;, buf: <span class="kw-2">&amp;mut </span>Vec&lt;u8&gt;) {
<span class="macro">::uniffi::deps::static_assertions::const_assert!</span>(::std::mem::size_of::&lt;<span class="kw-2">*const </span>::std::ffi::c_void&gt;() &lt;= <span class="number">8</span>);
::uniffi::deps::bytes::BufMut::put_u64(buf, #lower(obj) <span class="kw">as </span>u64);
::uniffi::deps::bytes::BufMut::put_u64(buf, #lower_arc(obj) <span class="kw">as </span>u64);
}

<span class="doccomment">/// When reading as a field of a complex structure, we receive a "borrow" of the `Arc`
Expand All @@ -395,7 +405,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
</span><span class="kw">fn </span>try_read(buf: <span class="kw-2">&amp;mut &amp;</span>[u8]) -&gt; ::uniffi::Result&lt;::std::sync::Arc&lt;<span class="self">Self</span>&gt;&gt; {
<span class="macro">::uniffi::deps::static_assertions::const_assert!</span>(::std::mem::size_of::&lt;<span class="kw-2">*const </span>::std::ffi::c_void&gt;() &lt;= <span class="number">8</span>);
::uniffi::check_remaining(buf, <span class="number">8</span>)<span class="question-mark">?</span>;
#try_lift(::uniffi::deps::bytes::Buf::get_u64(buf) <span class="kw">as </span><span class="self">Self</span>::FfiType)
#try_lift_arc(::uniffi::deps::bytes::Buf::get_u64(buf) <span class="kw">as </span><span class="self">Self</span>::FfiType)
}

<span class="kw">const </span>TYPE_ID_META: ::uniffi::MetadataBuffer = ::uniffi::MetadataBuffer::from_code(::uniffi::metadata::codes::TYPE_INTERFACE)
Expand All @@ -404,10 +414,16 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}

<span class="kw">unsafe </span>#lower_return_impl_spec {
<span class="kw">type </span>ReturnType = #lower_return_type;
<span class="kw">type </span>ReturnType = #lower_return_type_arc;

<span class="kw">fn </span>lower_return(obj: <span class="self">Self</span>) -&gt; ::std::result::Result&lt;<span class="self">Self</span>::ReturnType, ::uniffi::RustBuffer&gt; {
#lower_return(::std::sync::Arc::new(obj))
#lower_return_arc(::std::sync::Arc::new(obj))
}
}

<span class="kw">unsafe </span>#lower_error_impl_spec {
<span class="kw">fn </span>lower_error(obj: <span class="self">Self</span>) -&gt; ::uniffi::RustBuffer {
#lower_error_arc(::std::sync::Arc::new(obj))
}
}

Expand All @@ -416,7 +432,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}

#type_id_impl_spec {
<span class="kw">const </span>TYPE_ID_META: ::uniffi::MetadataBuffer = #type_id_meta;
<span class="kw">const </span>TYPE_ID_META: ::uniffi::MetadataBuffer = #type_id_meta_arc;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function() {var implementors = {
"uniffi":[]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.f32.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.f64.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.i16.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.i32.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.i64.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.i8.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.u16.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.u32.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.u64.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/type.impl/std/primitive.u8.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internals/api/uniffi/all.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ <h5 id="examples-39"><a class="doc-anchor" href="#examples-39">§</a>Examples</h
call_status: <a class="struct" href="../../../../../struct.RustCallStatus.html" title="struct uniffi::RustCallStatus">RustCallStatus</a>
) -&gt; Self</h4></section></summary><div class='docblock'>Lift a foreign returned value from a trait interface <a href="../../../../../trait.LiftReturn.html#method.lift_foreign_return">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LowerReturn%3CUT%3E-for-Result%3CR,+E%3E" class="impl"><a href="#impl-LowerReturn%3CUT%3E-for-Result%3CR,+E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;UT, R, E&gt; <a class="trait" href="../../../../../trait.LowerReturn.html" title="trait uniffi::LowerReturn">LowerReturn</a>&lt;UT&gt; for <a class="enum" href="../../result/enum.Result.html" title="enum uniffi::deps::static_assertions::_core::result::Result">Result</a>&lt;R, E&gt;<div class="where">where
R: <a class="trait" href="../../../../../trait.LowerReturn.html" title="trait uniffi::LowerReturn">LowerReturn</a>&lt;UT&gt;,
E: <a class="trait" href="../../../../../trait.Lower.html" title="trait uniffi::Lower">Lower</a>&lt;UT&gt; + <a class="trait" href="../../error/trait.Error.html" title="trait uniffi::deps::static_assertions::_core::error::Error">Error</a> + <a class="trait" href="../../marker/trait.Send.html" title="trait uniffi::deps::static_assertions::_core::marker::Send">Send</a> + <a class="trait" href="../../marker/trait.Sync.html" title="trait uniffi::deps::static_assertions::_core::marker::Sync">Sync</a> + 'static,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.ReturnType-1" class="associatedtype trait-impl"><a href="#associatedtype.ReturnType-1" class="anchor">§</a><h4 class="code-header">type <a href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType" class="associatedtype">ReturnType</a> = &lt;R as <a class="trait" href="../../../../../trait.LowerReturn.html" title="trait uniffi::LowerReturn">LowerReturn</a>&lt;UT&gt;&gt;::<a class="associatedtype" href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType" title="type uniffi::LowerReturn::ReturnType">ReturnType</a></h4></section></summary><div class='docblock'>The type that should be returned by scaffolding functions for this type. <a href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lower_return" class="method trait-impl"><a href="#method.lower_return" class="anchor">§</a><h4 class="code-header">fn <a href="../../../../../trait.LowerReturn.html#tymethod.lower_return" class="fn">lower_return</a>(
E: <a class="trait" href="../../../../../trait.LowerError.html" title="trait uniffi::LowerError">LowerError</a>&lt;UT&gt; + <a class="trait" href="../../fmt/trait.Display.html" title="trait uniffi::deps::static_assertions::_core::fmt::Display">Display</a> + <a class="trait" href="../../fmt/trait.Debug.html" title="trait uniffi::deps::static_assertions::_core::fmt::Debug">Debug</a> + <a class="trait" href="../../marker/trait.Send.html" title="trait uniffi::deps::static_assertions::_core::marker::Send">Send</a> + <a class="trait" href="../../marker/trait.Sync.html" title="trait uniffi::deps::static_assertions::_core::marker::Sync">Sync</a> + 'static,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.ReturnType-1" class="associatedtype trait-impl"><a href="#associatedtype.ReturnType-1" class="anchor">§</a><h4 class="code-header">type <a href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType" class="associatedtype">ReturnType</a> = &lt;R as <a class="trait" href="../../../../../trait.LowerReturn.html" title="trait uniffi::LowerReturn">LowerReturn</a>&lt;UT&gt;&gt;::<a class="associatedtype" href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType" title="type uniffi::LowerReturn::ReturnType">ReturnType</a></h4></section></summary><div class='docblock'>The type that should be returned by scaffolding functions for this type. <a href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lower_return" class="method trait-impl"><a href="#method.lower_return" class="anchor">§</a><h4 class="code-header">fn <a href="../../../../../trait.LowerReturn.html#tymethod.lower_return" class="fn">lower_return</a>(
v: <a class="enum" href="../../result/enum.Result.html" title="enum uniffi::deps::static_assertions::_core::result::Result">Result</a>&lt;R, E&gt;
) -&gt; <a class="enum" href="../../result/enum.Result.html" title="enum uniffi::deps::static_assertions::_core::result::Result">Result</a>&lt;&lt;<a class="enum" href="../../result/enum.Result.html" title="enum uniffi::deps::static_assertions::_core::result::Result">Result</a>&lt;R, E&gt; as <a class="trait" href="../../../../../trait.LowerReturn.html" title="trait uniffi::LowerReturn">LowerReturn</a>&lt;UT&gt;&gt;::<a class="associatedtype" href="../../../../../trait.LowerReturn.html#associatedtype.ReturnType" title="type uniffi::LowerReturn::ReturnType">ReturnType</a>, <a class="struct" href="../../../../../struct.RustBuffer.html" title="struct uniffi::RustBuffer">RustBuffer</a>&gt;</h4></section></summary><div class='docblock'>Lower this value for scaffolding function return <a href="../../../../../trait.LowerReturn.html#tymethod.lower_return">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.handle_failed_lift" class="method trait-impl"><a href="#method.handle_failed_lift" class="anchor">§</a><h4 class="code-header">fn <a href="../../../../../trait.LowerReturn.html#method.handle_failed_lift" class="fn">handle_failed_lift</a>(arg_name: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.77.1/std/primitive.str.html">str</a>, err: <a class="struct" href="../../../../anyhow/struct.Error.html" title="struct uniffi::deps::anyhow::Error">Error</a>) -&gt; <a class="enum" href="../../result/enum.Result.html" title="enum uniffi::deps::static_assertions::_core::result::Result">Result</a>&lt;R, E&gt;</h4></section></summary><div class='docblock'>If possible, get a serialized error for failed argument lifts <a href="../../../../../trait.LowerReturn.html#method.handle_failed_lift">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-Result%3CT,+E%3E" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.77.1/src/core/result.rs.html#498">source</a><a href="#impl-Ord-for-Result%3CT,+E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, E&gt; <a class="trait" href="../../cmp/trait.Ord.html" title="trait uniffi::deps::static_assertions::_core::cmp::Ord">Ord</a> for <a class="enum" href="../../result/enum.Result.html" title="enum uniffi::deps::static_assertions::_core::result::Result">Result</a>&lt;T, E&gt;<div class="where">where
T: <a class="trait" href="../../cmp/trait.Ord.html" title="trait uniffi::deps::static_assertions::_core::cmp::Ord">Ord</a>,
Expand Down
Loading

0 comments on commit 5f829ac

Please sign in to comment.