Skip to content

Commit

Permalink
deploy: 83d4480
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Jan 25, 2024
1 parent 09513f8 commit 9343bd8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 44 deletions.
2 changes: 1 addition & 1 deletion oo7/portal/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="File backend implementation backed by the Secret portal."><title>oo7::portal - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b1a3e7f8283b8434.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="oo7" data-themes="" data-resource-suffix="" data-rustdoc-version="1.77.0-nightly (7ffc697ce 2024-01-24)" data-channel="nightly" data-search-js="search-dd67cee4cfa65049.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-48f368f3872407c8.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-04d5337699b92874.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../oo7/index.html">oo7</a><span class="version">0.3.0</span></h2></div><h2 class="location"><a href="#">Module portal</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></section><h2><a href="../index.html">In crate oo7</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../oo7/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">oo7</a>::<wbr><a class="mod" href="#">portal</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/oo7/portal/mod.rs.html#1-422">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>File backend implementation backed by the <a href="https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Secret">Secret portal</a>.</p>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../oo7/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">oo7</a>::<wbr><a class="mod" href="#">portal</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/oo7/portal/mod.rs.html#1-410">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>File backend implementation backed by the <a href="https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Secret">Secret portal</a>.</p>

<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::collections::HashMap;

Expand Down
6 changes: 3 additions & 3 deletions src/oo7/dbus/collection.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}

<span class="attr">#[cfg(test)]
#[cfg(feature = <span class="string">"async-std"</span>)]
#[cfg(feature = <span class="string">"tokio"</span>)]
</span><span class="kw">mod </span>tests {
<span class="attr">#[cfg(feature = <span class="string">"local_tests"</span>)]
</span><span class="kw">use super</span>::<span class="kw-2">*</span>;
Expand Down Expand Up @@ -624,14 +624,14 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
);
}

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
#[cfg(feature = <span class="string">"local_tests"</span>)]
</span><span class="kw">async fn </span>create_plain_item() {
<span class="kw">let </span>service = Service::plain().<span class="kw">await</span>.unwrap();
create_item(service, <span class="bool-val">false</span>).<span class="kw">await</span>;
}

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
#[cfg(feature = <span class="string">"local_tests"</span>)]
</span><span class="kw">async fn </span>create_encrypted_item() {
<span class="kw">let </span>service = Service::encrypted().<span class="kw">await</span>.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/oo7/dbus/service.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}

<span class="attr">#[cfg(test)]
#[cfg(feature = <span class="string">"async-std"</span>)]
#[cfg(feature = <span class="string">"tokio"</span>)]
</span><span class="kw">mod </span>tests {
<span class="attr">#[cfg(feature = <span class="string">"local_tests"</span>)]
</span><span class="kw">use </span><span class="kw">super</span>::Service;

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
#[cfg(feature = <span class="string">"local_tests"</span>)]
</span><span class="kw">async fn </span>create_collection() {
<span class="kw">let </span>service = Service::new().<span class="kw">await</span>.unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/oo7/portal/api/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}

<span class="attr">#[cfg(test)]
#[cfg(feature = <span class="string">"async-std"</span>)]
#[cfg(feature = <span class="string">"tokio"</span>)]
</span><span class="kw">mod </span>tests {
<span class="kw">use super</span>::<span class="kw-2">*</span>;

Expand All @@ -692,7 +692,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="number">48</span>, <span class="number">159</span>, <span class="number">0</span>, <span class="number">146</span>,
];

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>keyfile_add_remove() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>needle = HashMap::from([(String::from(<span class="string">"key"</span>), String::from(<span class="string">"value"</span>))]);

Expand All @@ -712,7 +712,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="prelude-val">Ok</span>(())
}

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>keyfile_dump_load() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>_silent = std::fs::remove_file(<span class="string">"/tmp/test.keyring"</span>);

Expand All @@ -729,7 +729,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
);
new_keyring.dump(<span class="string">"/tmp/test.keyring"</span>, <span class="prelude-val">None</span>).<span class="kw">await</span><span class="question-mark">?</span>;

<span class="kw">let </span>blob = async_std::fs::read(<span class="string">"/tmp/test.keyring"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>blob = tokio::fs::read(<span class="string">"/tmp/test.keyring"</span>).<span class="kw">await</span><span class="question-mark">?</span>;

<span class="kw">let </span>loaded_keyring = Keyring::try_from(blob.as_slice())<span class="question-mark">?</span>;
<span class="kw">let </span>loaded_items =
Expand Down
44 changes: 10 additions & 34 deletions src/oo7/portal/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,6 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#408" id="408">408</a>
<a href="#409" id="409">409</a>
<a href="#410" id="410">410</a>
<a href="#411" id="411">411</a>
<a href="#412" id="412">412</a>
<a href="#413" id="413">413</a>
<a href="#414" id="414">414</a>
<a href="#415" id="415">415</a>
<a href="#416" id="416">416</a>
<a href="#417" id="417">417</a>
<a href="#418" id="418">418</a>
<a href="#419" id="419">419</a>
<a href="#420" id="420">420</a>
<a href="#421" id="421">421</a>
<a href="#422" id="422">422</a>
</pre></div><pre class="rust"><code><span class="doccomment">//! File backend implementation backed by the [Secret portal](https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Secret).
//!
//! ```no_run
Expand Down Expand Up @@ -744,22 +732,12 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}

<span class="attr">#[cfg(test)]
#[cfg(feature = <span class="string">"tokio"</span>)]
</span><span class="kw">mod </span>tests {
<span class="kw">use super</span>::<span class="kw-2">*</span>;

<span class="attr">#[cfg(feature = <span class="string">"async-std"</span>)]
#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>repeated_write() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
repeated_write_().<span class="kw">await
</span>}

<span class="attr">#[cfg(feature = <span class="string">"tokio"</span>)]
#[tokio::test]
</span><span class="kw">async fn </span>repeated_write() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
repeated_write_().<span class="kw">await
</span>}

<span class="kw">async fn </span>repeated_write_() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>path = std::path::PathBuf::from(<span class="string">"../../tests/test.keyring"</span>);

<span class="kw">let </span>secret = Secret::from(<span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>]);
Expand All @@ -771,8 +749,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="prelude-val">Ok</span>(())
}

<span class="attr">#[cfg(feature = <span class="string">"async-std"</span>)]
#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>delete() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>path = std::path::PathBuf::from(<span class="string">"../../tests/test-delete.keyring"</span>);

Expand All @@ -790,7 +767,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="prelude-val">Ok</span>(())
}

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>write_with_weak_key() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>path = std::path::PathBuf::from(<span class="string">"../../tests/write_with_weak_key.keyring"</span>);

Expand All @@ -809,7 +786,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="prelude-val">Ok</span>(())
}

<span class="attr">#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>write_with_strong_key() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>path = std::path::PathBuf::from(<span class="string">"../../tests/write_with_strong_key.keyring"</span>);

Expand All @@ -826,20 +803,19 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
Secret::from([<span class="number">1</span>, <span class="number">2</span>].into_iter().cycle().take(<span class="number">64</span>).collect::&lt;Vec&lt;<span class="kw">_</span>&gt;&gt;())
}

<span class="attr">#[cfg(feature = <span class="string">"async-std"</span>)]
#[async_std::test]
<span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>concurrent_writes() -&gt; <span class="prelude-ty">Result</span>&lt;(), Error&gt; {
<span class="kw">let </span>path = std::path::PathBuf::from(<span class="string">"../../tests/concurrent_writes.keyring"</span>);

<span class="kw">let </span>keyring = Arc::new(Keyring::load(<span class="kw-2">&amp;</span>path, strong_key()).<span class="kw">await</span><span class="question-mark">?</span>);

<span class="kw">let </span>keyring_clone = keyring.clone();
<span class="kw">let </span>handle_1 = async_std::task::spawn(<span class="kw">async move </span>{ keyring_clone.write().<span class="kw">await </span>});
<span class="kw">let </span>handle_2 = async_std::task::spawn(<span class="kw">async move </span>{ keyring.write().<span class="kw">await </span>});
<span class="kw">let </span>handle_1 = tokio::task::spawn(<span class="kw">async move </span>{ keyring_clone.write().<span class="kw">await </span>});
<span class="kw">let </span>handle_2 = tokio::task::spawn(<span class="kw">async move </span>{ keyring.write().<span class="kw">await </span>});

<span class="kw">let </span>(res_1, res_2) = futures_util::future::join(handle_1, handle_2).<span class="kw">await</span>;
res_1<span class="question-mark">?</span>;
res_2<span class="question-mark">?</span>;
res_1.unwrap()<span class="question-mark">?</span>;
res_2.unwrap()<span class="question-mark">?</span>;

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

0 comments on commit 9343bd8

Please sign in to comment.