This commit is contained in:
wash2 2026-04-18 20:11:25 +00:00
commit 0fa87f2b35
16382 changed files with 734838 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
<!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="Create a new asynchronous channel"><title>channel in cosmic::cctk::sctk::reexports::calloop::channel - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop::<wbr>channel</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a>::<wbr><a href="index.html">channel</a></div><h1>Function <span class="fn">channel</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub fn channel&lt;T&gt;() -&gt; (<a class="struct" href="struct.Sender.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Sender">Sender</a>&lt;T&gt;, <a class="struct" href="struct.Channel.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Channel">Channel</a>&lt;T&gt;)</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new asynchronous channel</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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="Create a new synchronous, bounded channel"><title>sync_channel in cosmic::cctk::sctk::reexports::calloop::channel - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop::<wbr>channel</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a>::<wbr><a href="index.html">channel</a></div><h1>Function <span class="fn">sync_channel</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub fn sync_channel&lt;T&gt;(bound: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; (<a class="struct" href="struct.SyncSender.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::SyncSender">SyncSender</a>&lt;T&gt;, <a class="struct" href="struct.Channel.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Channel">Channel</a>&lt;T&gt;)</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new synchronous, bounded channel</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,8 @@
<!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="An MPSC channel whose receiving end is an event source"><title>cosmic::cctk::sctk::reexports::calloop::channel - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module channel</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>channel</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An MPSC channel whose receiving end is an event source</p>
<p>Create a channel using <a href="fn.channel.html" title="fn cosmic::cctk::sctk::reexports::calloop::channel::channel"><code>channel()</code></a>, which returns a
<a href="struct.Sender.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Sender"><code>Sender</code></a> that can be cloned and sent accross threads if <code>T: Send</code>,
and a <a href="struct.Channel.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Channel"><code>Channel</code></a> that can be inserted into an <a href="../struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a>.
It will generate one event per message.</p>
<p>A synchronous version of the channel is provided by <a href="fn.sync_channel.html" title="fn cosmic::cctk::sctk::reexports::calloop::channel::sync_channel"><code>sync_channel</code></a>, in which
the <a href="struct.SyncSender.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::SyncSender"><code>SyncSender</code></a> will block when the channel is full.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Channel.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Channel">Channel</a></dt><dd>The receiving end of the channel</dd><dt><a class="struct" href="struct.ChannelError.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::ChannelError">Channel<wbr>Error</a></dt><dd>An error arising from processing events for a channel.</dd><dt><a class="struct" href="struct.Sender.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::Sender">Sender</a></dt><dd>The sender end of a channel</dd><dt><a class="struct" href="struct.SyncSender.html" title="struct cosmic::cctk::sctk::reexports::calloop::channel::SyncSender">Sync<wbr>Sender</a></dt><dd>The sender end of a synchronous channel</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Event.html" title="enum cosmic::cctk::sctk::reexports::calloop::channel::Event">Event</a></dt><dd>The events generated by the channel event source</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.channel.html" title="fn cosmic::cctk::sctk::reexports::calloop::channel::channel">channel</a></dt><dd>Create a new asynchronous channel</dd><dt><a class="fn" href="fn.sync_channel.html" title="fn cosmic::cctk::sctk::reexports::calloop::channel::sync_channel">sync_<wbr>channel</a></dt><dd>Create a new synchronous, bounded channel</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Event"],"fn":["channel","sync_channel"],"struct":["Channel","ChannelError","Sender","SyncSender"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,19 @@
<!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="Error types used and generated by Calloop."><title>cosmic::cctk::sctk::reexports::calloop::error - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module error</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>error</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Error types used and generated by Calloop.</p>
<p>This module contains error types for Calloop’s operations. They are designed
to make it easy to deal with errors arising from Calloop’s internal I/O and
other operations.</p>
<p>There are two top-level error types:</p>
<ul>
<li>
<p><a href="../enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error"><code>Error</code></a>: used by callback functions, internal operations, and some event
loop API calls</p>
</li>
<li>
<p><a href="../struct.InsertError.html" title="struct cosmic::cctk::sctk::reexports::calloop::InsertError"><code>InsertError</code></a>: used primarily by the <a href="../struct.LoopHandle.html#method.insert_source" title="method cosmic::cctk::sctk::reexports::calloop::LoopHandle::insert_source"><code>insert_source()</code></a> method when an
event source cannot be added to the loop and needs to be given back to the
caller</p>
</li>
</ul>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.InsertError.html" title="struct cosmic::cctk::sctk::reexports::calloop::error::InsertError">Insert<wbr>Error</a></dt><dd>An error generated when trying to insert an event source</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::error::Error">Error</a></dt><dd>The primary error type used by Calloop covering internal errors and I/O
errors that arise during loop operations such as source registration or
event dispatching.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Result.html" title="type cosmic::cctk::sctk::reexports::calloop::error::Result">Result</a></dt><dd><a href="../type.Result.html" title="type cosmic::cctk::sctk::reexports::calloop::Result"><code>Result</code></a> alias using Calloop’s error type.</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["InsertError"],"type":["Result"]};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
<!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="`Result` alias using Calloop’s error type."><title>Result in cosmic::cctk::sctk::reexports::calloop::error - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Result</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Err" title="Err">Err</a></li><li><a href="#variant.Ok" title="Ok">Ok</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop::<wbr>error</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a>::<wbr><a href="index.html">error</a></div><h1>Type Alias <span class="type">Result</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type Result&lt;T&gt; = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="enum" href="../enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a>&gt;;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="../type.Result.html" title="type cosmic::cctk::sctk::reexports::calloop::Result"><code>Result</code></a> alias using Calloop’s error type.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub enum Result&lt;T&gt; {
Ok(T),
Err(<a class="enum" href="../enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a>),
}</code></pre><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.Ok" class="variant"><a href="#variant.Ok" class="anchor">§</a><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><h3 class="code-header">Ok(T)</h3></section><div class="docblock"><p>Contains the success value</p>
</div><section id="variant.Err" class="variant"><a href="#variant.Err" class="anchor">§</a><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><h3 class="code-header">Err(<a class="enum" href="../enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a>)</h3></section><div class="docblock"><p>Contains the error value</p>
</div></div><script src="../../../../../../type.impl/core/result/enum.Result.js" data-self-path="cosmic::cctk::sctk::reexports::calloop::Result" async></script></section></div></main></body></html>

View file

@ -0,0 +1,27 @@
<!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="A generic event source wrapping an IO objects or file descriptor"><title>cosmic::cctk::sctk::reexports::calloop::generic - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module generic</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>generic</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A generic event source wrapping an IO objects or file descriptor</p>
<p>You can use this general purpose adapter around file-descriptor backed objects to
insert into an <a href="../struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a>.</p>
<p>The event generated by this <a href="struct.Generic.html" title="struct cosmic::cctk::sctk::reexports::calloop::generic::Generic"><code>Generic</code></a> event source are the <a href="../struct.Readiness.html" title="struct cosmic::cctk::sctk::reexports::calloop::Readiness"><code>Readiness</code></a>
notification itself, and the monitored object is provided to your callback as the second
argument.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>calloop::{generic::Generic, Interest, Mode, PostAction};
handle.insert_source(
<span class="comment">// wrap your IO object in a Generic, here we register for read readiness
// in level-triggering mode
</span>Generic::new(io_object, Interest::READ, Mode::Level),
|readiness, io_object, shared_data| {
<span class="comment">// The first argument of the callback is a Readiness
// The second is a &amp;mut reference to your object
// your callback needs to return a Result&lt;PostAction, std::io::Error&gt;
// if it returns an error, the event loop will consider this event
// event source as erroring and report it to the user.
</span><span class="prelude-val">Ok</span>(PostAction::Continue)
}
);</code></pre></div>
<p>It can also help you implementing your own event sources: just have
these <code>Generic&lt;_&gt;</code> as fields of your event source, and delegate the
<a href="../trait.EventSource.html" title="trait cosmic::cctk::sctk::reexports::calloop::EventSource"><code>EventSource</code></a> implementation to them.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.FdWrapper.html" title="struct cosmic::cctk::sctk::reexports::calloop::generic::FdWrapper">FdWrapper</a></dt><dd>Wrapper to use a type implementing <code>AsRawFd</code> but not <code>AsFd</code> with <code>Generic</code></dd><dt><a class="struct" href="struct.Generic.html" title="struct cosmic::cctk::sctk::reexports::calloop::generic::Generic">Generic</a></dt><dd>A generic event source wrapping a FD-backed type</dd><dt><a class="struct" href="struct.NoIoDrop.html" title="struct cosmic::cctk::sctk::reexports::calloop::generic::NoIoDrop">NoIo<wbr>Drop</a></dt><dd>A wrapper around a type that doesn’t expose it mutably safely.</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["FdWrapper","Generic","NoIoDrop"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,130 @@
<!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="Calloop, a Callback-based Event Loop"><title>cosmic::cctk::sctk::reexports::calloop - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../../../../../crates.js"></script><script defer src="../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[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="../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#how-to-use-it" title="How to use it">How to use it</a></li><li><a href="#event-source-types" title="Event source types">Event source types</a></li><li><a href="#asyncawait-compatibility" title="Async/Await compatibility">Async/Await compatibility</a></li><li><a href="#custom-event-sources" title="Custom event sources">Custom event sources</a></li><li><a href="#platforms-support" title="Platforms support">Platforms support</a></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">cosmic</a>::<wbr><a href="../../../index.html">cctk</a>::<wbr><a href="../../index.html">sctk</a>::<wbr><a href="../index.html">reexports</a></div><h1>Crate <span>calloop</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Calloop, a Callback-based Event Loop</p>
<p>This crate provides an <a href="struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a> type, which is a small abstraction
over a polling system. The main difference between this crate
and other traditional rust event loops is that it is based on callbacks:
you can register several event sources, each being associated with a callback
closure that will be invoked whenever the associated event source generates
events.</p>
<p>The main target use of this event loop is thus for apps that expect to spend
most of their time waiting for events and wishes to do so in a cheap and convenient
way. It is not meant for large scale high performance IO.</p>
<h3 id="how-to-use-it"><a class="doc-anchor" href="#how-to-use-it">§</a>How to use it</h3>
<p>Below is a quick usage example of calloop. For a more in-depth tutorial, see
the <a href="https://smithay.github.io/calloop">calloop book</a>.</p>
<p>For simple uses, you can just add event sources with callbacks to the event
loop. For example, here’s a runnable program that exits after five seconds:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>calloop::{timer::{Timer, TimeoutAction}, EventLoop, LoopSignal};
<span class="kw">fn </span>main() {
<span class="comment">// Create the event loop. The loop is parameterised by the kind of shared
// data you want the callbacks to use. In this case, we want to be able to
// stop the loop when the timer fires, so we provide the loop with a
// LoopSignal, which has the ability to stop the loop from within events. We
// just annotate the type here; the actual data is provided later in the
// run() call.
</span><span class="kw">let </span><span class="kw-2">mut </span>event_loop: EventLoop&lt;LoopSignal&gt; =
EventLoop::try_new().expect(<span class="string">"Failed to initialize the event loop!"</span>);
<span class="comment">// Retrieve a handle. It is used to insert new sources into the event loop
// It can be cloned, allowing you to insert sources from within source
// callbacks.
</span><span class="kw">let </span>handle = event_loop.handle();
<span class="comment">// Create our event source, a timer, that will expire in 2 seconds
</span><span class="kw">let </span>source = Timer::from_duration(std::time::Duration::from_secs(<span class="number">2</span>));
<span class="comment">// Inserting an event source takes this general form. It can also be done
// from within the callback of another event source.
</span>handle
.insert_source(
<span class="comment">// a type which implements the EventSource trait
</span>source,
<span class="comment">// a callback that is invoked whenever this source generates an event
</span>|event, _metadata, shared_data| {
<span class="comment">// This callback is given 3 values:
// - the event generated by the source (in our case, timer events are the Instant
// representing the deadline for which it has fired)
// - &amp;mut access to some metadata, specific to the event source (in our case, a
// timer handle)
// - &amp;mut access to the global shared data that was passed to EventLoop::run or
// EventLoop::dispatch (in our case, a LoopSignal object to stop the loop)
//
// The return type is just () because nothing uses it. Some
// sources will expect a Result of some kind instead.
</span><span class="macro">println!</span>(<span class="string">"Timeout for {:?} expired!"</span>, event);
<span class="comment">// notify the event loop to stop running using the signal in the shared data
// (see below)
</span>shared_data.stop();
<span class="comment">// The timer event source requires us to return a TimeoutAction to
// specify if the timer should be rescheduled. In our case we just drop it.
</span>TimeoutAction::Drop
},
)
.expect(<span class="string">"Failed to insert event source!"</span>);
<span class="comment">// Create the shared data for our loop.
</span><span class="kw">let </span><span class="kw-2">mut </span>shared_data = event_loop.get_signal();
<span class="comment">// Actually run the event loop. This will dispatch received events to their
// callbacks, waiting at most 20ms for new events between each invocation of
// the provided callback (pass None for the timeout argument if you want to
// wait indefinitely between events).
//
// This is where we pass the *value* of the shared data, as a mutable
// reference that will be forwarded to all your callbacks, allowing them to
// share some state
</span>event_loop
.run(
std::time::Duration::from_millis(<span class="number">20</span>),
<span class="kw-2">&amp;mut </span>shared_data,
|_shared_data| {
<span class="comment">// Finally, this is where you can insert the processing you need
// to do do between each waiting event eg. drawing logic if
// you're doing a GUI app.
</span>},
)
.expect(<span class="string">"Error during event loop!"</span>);
}</code></pre></div>
<h3 id="event-source-types"><a class="doc-anchor" href="#event-source-types">§</a>Event source types</h3>
<p>The event loop is backed by an OS provided polling selector (epoll on Linux).</p>
<p>This crate also provide some adapters for common event sources such as:</p>
<ul>
<li><a href="channel/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::channel">MPSC channels</a></li>
<li><a href="timer/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::timer">Timers</a></li>
<li><a href="signals">unix signals</a> on Linux</li>
</ul>
<p>As well as generic objects backed by file descriptors.</p>
<p>It is also possible to insert “idle” callbacks. These callbacks represent computations that
need to be done at some point, but are not as urgent as processing the events. These callbacks
are stored and then executed during <a href="struct.EventLoop.html#method.dispatch" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop::dispatch</code></a>, once all
events from the sources have been processed.</p>
<h3 id="asyncawait-compatibility"><a class="doc-anchor" href="#asyncawait-compatibility">§</a>Async/Await compatibility</h3>
<p><code>calloop</code> can be used with futures, both as an executor and for monitoring Async IO.</p>
<p>Activating the <code>executor</code> cargo feature will add the [<code>futures</code>] module, which provides
a future executor that can be inserted into an <a href="struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a> as yet another <a href="trait.EventSource.html" title="trait cosmic::cctk::sctk::reexports::calloop::EventSource"><code>EventSource</code></a>.</p>
<p>IO objects can be made Async-aware via the <a href="struct.LoopHandle.html#method.adapt_io" title="struct cosmic::cctk::sctk::reexports::calloop::LoopHandle"><code>LoopHandle::adapt_io</code></a>
method. Waking up the futures using these objects is handled by the associated <a href="struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a>
directly.</p>
<h3 id="custom-event-sources"><a class="doc-anchor" href="#custom-event-sources">§</a>Custom event sources</h3>
<p>You can create custom event sources can will be inserted in the event loop by
implementing the <a href="trait.EventSource.html" title="trait cosmic::cctk::sctk::reexports::calloop::EventSource"><code>EventSource</code></a> trait. This can be done either directly from the file
descriptors of your source of interest, or by wrapping an other event source and further
processing its events. An <a href="trait.EventSource.html" title="trait cosmic::cctk::sctk::reexports::calloop::EventSource"><code>EventSource</code></a> can register more than one file descriptor and
aggregate them.</p>
<h3 id="platforms-support"><a class="doc-anchor" href="#platforms-support">§</a>Platforms support</h3>
<p>Currently, calloop is tested on Linux, FreeBSD and macOS.</p>
<p>The following platforms are also enabled at compile time but not tested: Android, NetBSD,
OpenBSD, DragonFlyBSD.</p>
<p>Those platforms <em>should</em> work based on the fact that they have the same polling mechanism as
tested platforms, but some subtle bugs might still occur.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="channel/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::channel">channel</a></dt><dd>An MPSC channel whose receiving end is an event source</dd><dt><a class="mod" href="error/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::error">error</a></dt><dd>Error types used and generated by Calloop.</dd><dt><a class="mod" href="generic/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::generic">generic</a></dt><dd>A generic event source wrapping an IO objects or file descriptor</dd><dt><a class="mod" href="io/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::io">io</a></dt><dd>Adapters for async IO objects</dd><dt><a class="mod" href="ping/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::ping">ping</a></dt><dd>Ping to the event loop</dd><dt><a class="mod" href="timer/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::timer">timer</a></dt><dd>Timer event source</dd><dt><a class="mod" href="transient/index.html" title="mod cosmic::cctk::sctk::reexports::calloop::transient">transient</a></dt><dd>Wrapper for a transient Calloop event source.</dd></dl><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro.batch_register.html" title="macro cosmic::cctk::sctk::reexports::calloop::batch_register">batch_<wbr>register</a></dt><dd>Register a set of event sources. Effectively calls
<a href="trait.EventSource.html#tymethod.register" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::register"><code>EventSource::register()</code></a> for all the sources provided.</dd><dt><a class="macro" href="macro.batch_reregister.html" title="macro cosmic::cctk::sctk::reexports::calloop::batch_reregister">batch_<wbr>reregister</a></dt><dd>Reregister a set of event sources. Effectively calls
<a href="trait.EventSource.html#tymethod.reregister" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::reregister"><code>EventSource::reregister()</code></a> for all the sources provided.</dd><dt><a class="macro" href="macro.batch_unregister.html" title="macro cosmic::cctk::sctk::reexports::calloop::batch_unregister">batch_<wbr>unregister</a></dt><dd>Unregister a set of event sources. Effectively calls
<a href="trait.EventSource.html#tymethod.unregister" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::unregister"><code>EventSource::unregister()</code></a> for all the sources provided.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Dispatcher.html" title="struct cosmic::cctk::sctk::reexports::calloop::Dispatcher">Dispatcher</a></dt><dd>An event source with its callback.</dd><dt><a class="struct" href="struct.EventIterator.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventIterator">Event<wbr>Iterator</a></dt><dd>The EventIterator is an <code>Iterator</code> over the events relevant to a particular source
This type is used in the <a href="trait.EventSource.html#method.before_handle_events" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::before_handle_events"><code>EventSource::before_handle_events</code></a> methods for
two main reasons:</dd><dt><a class="struct" href="struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop">Event<wbr>Loop</a></dt><dd>An event loop</dd><dt><a class="struct" href="struct.Idle.html" title="struct cosmic::cctk::sctk::reexports::calloop::Idle">Idle</a></dt><dd>An idle callback that was inserted in this loop</dd><dt><a class="struct" href="struct.InsertError.html" title="struct cosmic::cctk::sctk::reexports::calloop::InsertError">Insert<wbr>Error</a></dt><dd>An error generated when trying to insert an event source</dd><dt><a class="struct" href="struct.Interest.html" title="struct cosmic::cctk::sctk::reexports::calloop::Interest">Interest</a></dt><dd>Interest to register regarding the file descriptor</dd><dt><a class="struct" href="struct.LoopHandle.html" title="struct cosmic::cctk::sctk::reexports::calloop::LoopHandle">Loop<wbr>Handle</a></dt><dd>A handle to an event loop</dd><dt><a class="struct" href="struct.LoopSignal.html" title="struct cosmic::cctk::sctk::reexports::calloop::LoopSignal">Loop<wbr>Signal</a></dt><dd>A signal that can be shared between thread to stop or wakeup a running
event loop</dd><dt><a class="struct" href="struct.Poll.html" title="struct cosmic::cctk::sctk::reexports::calloop::Poll">Poll</a></dt><dd>The polling system</dd><dt><a class="struct" href="struct.Readiness.html" title="struct cosmic::cctk::sctk::reexports::calloop::Readiness">Readiness</a></dt><dd>Readiness for a file descriptor notification</dd><dt><a class="struct" href="struct.RegistrationToken.html" title="struct cosmic::cctk::sctk::reexports::calloop::RegistrationToken">Registration<wbr>Token</a></dt><dd>A token representing a registration in the <a href="struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a>.</dd><dt><a class="struct" href="struct.Token.html" title="struct cosmic::cctk::sctk::reexports::calloop::Token">Token</a></dt><dd>A token (for implementation of the <a href="trait.EventSource.html" title="trait cosmic::cctk::sctk::reexports::calloop::EventSource"><code>EventSource</code></a> trait)</dd><dt><a class="struct" href="struct.TokenFactory.html" title="struct cosmic::cctk::sctk::reexports::calloop::TokenFactory">Token<wbr>Factory</a></dt><dd>Factory for creating tokens in your registrations</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a></dt><dd>The primary error type used by Calloop covering internal errors and I/O
errors that arise during loop operations such as source registration or
event dispatching.</dd><dt><a class="enum" href="enum.Mode.html" title="enum cosmic::cctk::sctk::reexports::calloop::Mode">Mode</a></dt><dd>Possible modes for registering a file descriptor</dd><dt><a class="enum" href="enum.PostAction.html" title="enum cosmic::cctk::sctk::reexports::calloop::PostAction">Post<wbr>Action</a></dt><dd>Possible actions that can be requested to the event loop by an
event source once its events have been processed.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.EventSource.html" title="trait cosmic::cctk::sctk::reexports::calloop::EventSource">Event<wbr>Source</a></dt><dd>Trait representing an event source</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Result.html" title="type cosmic::cctk::sctk::reexports::calloop::Result">Result</a></dt><dd><a href="type.Result.html" title="type cosmic::cctk::sctk::reexports::calloop::Result"><code>Result</code></a> alias using Calloop’s error type.</dd></dl></section></div></main></body></html>

View file

@ -0,0 +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="Adapters for async IO objects"><title>cosmic::cctk::sctk::reexports::calloop::io - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module io</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>io</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Adapters for async IO objects</p>
<p>This module mainly hosts the <a href="struct.Async.html" title="struct cosmic::cctk::sctk::reexports::calloop::io::Async"><code>Async</code></a> adapter for making IO objects async with readiness
monitoring backed by an <a href="../struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a>. See <a href="../struct.LoopHandle.html#method.adapt_io" title="struct cosmic::cctk::sctk::reexports::calloop::LoopHandle"><code>LoopHandle::adapt_io</code></a> for
how to create them.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Async.html" title="struct cosmic::cctk::sctk::reexports::calloop::io::Async">Async</a></dt><dd>Adapter for async IO manipulations</dd><dt><a class="struct" href="struct.Readable.html" title="struct cosmic::cctk::sctk::reexports::calloop::io::Readable">Readable</a></dt><dd>A future that resolves once the associated object becomes ready for reading</dd><dt><a class="struct" href="struct.Writable.html" title="struct cosmic::cctk::sctk::reexports::calloop::io::Writable">Writable</a></dt><dd>A future that resolves once the associated object becomes ready for writing</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Async","Readable","Writable"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.batch_register.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.batch_register.html">macro.batch_register.html</a>...</p>
<script>location.replace("macro.batch_register.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,17 @@
<!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="Register a set of event sources. Effectively calls `EventSource::register()` for all the sources provided."><title>batch_register in cosmic::cctk::sctk::reexports::calloop - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[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="../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">cosmic</a>::<wbr><a href="../../../index.html">cctk</a>::<wbr><a href="../../index.html">sctk</a>::<wbr><a href="../index.html">reexports</a>::<wbr><a href="index.html">calloop</a></div><h1>Macro <span class="macro">batch_register</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! batch_register {
($poll:ident, $token_fac:ident, $( $source:expr ),* $(,)?) =&gt; { ... };
}</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Register a set of event sources. Effectively calls
<a href="trait.EventSource.html#tymethod.register" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::register"><code>EventSource::register()</code></a> for all the sources provided.</p>
<p>Usage:</p>
<div class="example-wrap"><pre class="language-none"><code>calloop::batch_register!(
poll, token_factory,
self.source_one,
self.source_two,
self.source_three,
self.source_four,
)</code></pre></div>
<p>Note that there is no scope for customisation; if you need to do special
things with a particular source, you’ll need to leave it off the list. Also
note that this only does try-or-early-return error handling in the order
that you list the sources; if you need anything else, don’t use this macro.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.batch_reregister.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.batch_reregister.html">macro.batch_reregister.html</a>...</p>
<script>location.replace("macro.batch_reregister.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,17 @@
<!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="Reregister a set of event sources. Effectively calls `EventSource::reregister()` for all the sources provided."><title>batch_reregister in cosmic::cctk::sctk::reexports::calloop - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[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="../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">cosmic</a>::<wbr><a href="../../../index.html">cctk</a>::<wbr><a href="../../index.html">sctk</a>::<wbr><a href="../index.html">reexports</a>::<wbr><a href="index.html">calloop</a></div><h1>Macro <span class="macro">batch_reregister</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! batch_reregister {
($poll:ident, $token_fac:ident, $( $source:expr ),* $(,)?) =&gt; { ... };
}</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reregister a set of event sources. Effectively calls
<a href="trait.EventSource.html#tymethod.reregister" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::reregister"><code>EventSource::reregister()</code></a> for all the sources provided.</p>
<p>Usage:</p>
<div class="example-wrap"><pre class="language-none"><code>calloop::batch_reregister!(
poll, token_factory,
self.source_one,
self.source_two,
self.source_three,
self.source_four,
)</code></pre></div>
<p>Note that there is no scope for customisation; if you need to do special
things with a particular source, you’ll need to leave it off the list. Also
note that this only does try-or-early-return error handling in the order
that you list the sources; if you need anything else, don’t use this macro.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.batch_unregister.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.batch_unregister.html">macro.batch_unregister.html</a>...</p>
<script>location.replace("macro.batch_unregister.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,17 @@
<!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="Unregister a set of event sources. Effectively calls `EventSource::unregister()` for all the sources provided."><title>batch_unregister in cosmic::cctk::sctk::reexports::calloop - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[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="../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">cosmic</a>::<wbr><a href="../../../index.html">cctk</a>::<wbr><a href="../../index.html">sctk</a>::<wbr><a href="../index.html">reexports</a>::<wbr><a href="index.html">calloop</a></div><h1>Macro <span class="macro">batch_unregister</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! batch_unregister {
($poll:ident, $( $source:expr ),* $(,)?) =&gt; { ... };
}</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unregister a set of event sources. Effectively calls
<a href="trait.EventSource.html#tymethod.unregister" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::unregister"><code>EventSource::unregister()</code></a> for all the sources provided.</p>
<p>Usage:</p>
<div class="example-wrap"><pre class="language-none"><code>calloop::batch_unregister!(
poll,
self.source_one,
self.source_two,
self.source_three,
self.source_four,
)</code></pre></div>
<p>Note that there is no scope for customisation; if you need to do special
things with a particular source, you’ll need to leave it off the list. Also
note that this only does try-or-early-return error handling in the order
that you list the sources; if you need anything else, don’t use this macro.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +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="Create a new ping event source"><title>make_ping in cosmic::cctk::sctk::reexports::calloop::ping - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop::<wbr>ping</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a>::<wbr><a href="index.html">ping</a></div><h1>Function <span class="fn">make_ping</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub fn make_ping() -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(Ping, PingSource), <a class="struct" href="../../../../../iced/daemon/program/graphics/futures/futures/io/struct.Error.html" title="struct cosmic::iced::daemon::program::graphics::futures::futures::io::Error">Error</a>&gt;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new ping event source</p>
<p>you are given a <a href="type.Ping.html" title="type cosmic::cctk::sctk::reexports::calloop::ping::Ping"><code>Ping</code></a> instance, which can be cloned and used to ping the
event loop, and a <a href="type.PingSource.html" title="type cosmic::cctk::sctk::reexports::calloop::ping::PingSource"><code>PingSource</code></a>, which you can insert in your event loop to
receive the pings.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,9 @@
<!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="Ping to the event loop"><title>cosmic::cctk::sctk::reexports::calloop::ping - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module ping</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>ping</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Ping to the event loop</p>
<p>This is an event source that just produces <code>()</code> events whevener the associated
<a href="type.Ping.html#method.ping" title="type cosmic::cctk::sctk::reexports::calloop::ping::Ping"><code>Ping::ping</code></a> method is called. If the event source is pinged multiple times
between a single dispatching, it’ll only generate one event.</p>
<p>This event source is a simple way of waking up the event loop from an other part of your program
(and is what backs the <a href="../struct.LoopSignal.html" title="struct cosmic::cctk::sctk::reexports::calloop::LoopSignal"><code>LoopSignal</code></a>). It can also be used as a building
block to construct event sources whose source of event is not file descriptor, but rather an
userspace source (like an other thread).</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.PingError.html" title="struct cosmic::cctk::sctk::reexports::calloop::ping::PingError">Ping<wbr>Error</a></dt><dd>An error arising from processing events for a ping.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.make_ping.html" title="fn cosmic::cctk::sctk::reexports::calloop::ping::make_ping">make_<wbr>ping</a></dt><dd>Create a new ping event source</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Ping.html" title="type cosmic::cctk::sctk::reexports::calloop::ping::Ping">Ping</a></dt><dd>The ping event source</dd><dt><a class="type" href="type.PingSource.html" title="type cosmic::cctk::sctk::reexports::calloop::ping::PingSource">Ping<wbr>Source</a></dt><dd>The Ping handle</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["make_ping"],"struct":["PingError"],"type":["Ping","PingSource"]};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +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="The ping event source"><title>Ping in cosmic::cctk::sctk::reexports::calloop::ping - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Ping</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop::<wbr>ping</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a>::<wbr><a href="index.html">ping</a></div><h1>Type Alias <span class="type">Ping</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type Ping = Ping;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The ping event source</p>
<p>You can insert it in your event loop to receive pings.</p>
<p>If you use it directly, it will automatically remove itself from the event loop
once all <a href="type.Ping.html" title="type cosmic::cctk::sctk::reexports::calloop::ping::Ping"><code>Ping</code></a> instances are dropped.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Ping { <span class="comment">/* private fields */</span> }</code></pre><script src="../../../../../../type.impl/calloop/sources/ping/eventfd/struct.Ping.js" data-self-path="cosmic::cctk::sctk::reexports::calloop::ping::Ping" async></script></section></div></main></body></html>

View file

@ -0,0 +1,4 @@
<!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="The Ping handle"><title>PingSource in cosmic::cctk::sctk::reexports::calloop::ping - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Ping<wbr>Source</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop::<wbr>ping</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a>::<wbr><a href="index.html">ping</a></div><h1>Type Alias <span class="type">PingSource</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type PingSource = PingSource;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The Ping handle</p>
<p>This handle can be cloned and sent accross threads. It can be used to
send pings to the <code>PingSource</code>.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct PingSource { <span class="comment">/* private fields */</span> }</code></pre><script src="../../../../../../type.impl/calloop/sources/ping/eventfd/struct.PingSource.js" data-self-path="cosmic::cctk::sctk::reexports::calloop::ping::PingSource" async></script></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Error","Mode","PostAction"],"macro":["batch_register","batch_reregister","batch_unregister"],"mod":["channel","error","generic","io","ping","timer","transient"],"struct":["Dispatcher","EventIterator","EventLoop","Idle","InsertError","Interest","LoopHandle","LoopSignal","Poll","Readiness","RegistrationToken","Token","TokenFactory"],"trait":["EventSource"],"type":["Result"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,15 @@
<!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="Timer event source"><title>cosmic::cctk::sctk::reexports::calloop::timer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module timer</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>timer</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Timer event source</p>
<p>The <a href="struct.Timer.html" title="struct cosmic::cctk::sctk::reexports::calloop::timer::Timer"><code>Timer</code></a> is an event source that will fire its event after a certain amount of time
specified at creation. Its timing is tracked directly by the event loop core logic, and it does
not consume any system resource.</p>
<p>As of calloop v0.11.0, the event loop always uses high-precision timers. However, the timer
precision varies between operating systems; for instance, the scheduler granularity on Windows
is about 16 milliseconds. If you need to rely on good precision timers in general, you may need
to enable realtime features of your OS to ensure your thread is quickly woken up by the system
scheduler.</p>
<p>The provided event is an <a href="../../../../../iced/time/struct.Instant.html" title="struct cosmic::iced::time::Instant"><code>Instant</code></a> representing the deadline for which this timer has fired
(which can be earlier than the current time depending on the event loop congestion).</p>
<p>The callback associated with this event source is expected to return a <a href="enum.TimeoutAction.html" title="enum cosmic::cctk::sctk::reexports::calloop::timer::TimeoutAction"><code>TimeoutAction</code></a>, which
can be used to implement self-repeating timers by telling calloop to reprogram the same timer
for a later timeout after it has fired.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.TimeoutFuture.html" title="struct cosmic::cctk::sctk::reexports::calloop::timer::TimeoutFuture">Timeout<wbr>Future</a></dt><dd>A future that resolves once a certain timeout is expired</dd><dt><a class="struct" href="struct.Timer.html" title="struct cosmic::cctk::sctk::reexports::calloop::timer::Timer">Timer</a></dt><dd>A timer event source</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.TimeoutAction.html" title="enum cosmic::cctk::sctk::reexports::calloop::timer::TimeoutAction">Timeout<wbr>Action</a></dt><dd>Action to reschedule a timeout if necessary</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["TimeoutAction"],"struct":["TimeoutFuture","Timer"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,9 @@
<!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="Wrapper for a transient Calloop event source."><title>cosmic::cctk::sctk::reexports::calloop::transient - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module transient</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">calloop</a></div><h1>Module <span>transient</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Wrapper for a transient Calloop event source.</p>
<p>If you have high level event source that you expect to remain in the event
loop indefinitely, and another event source nested inside that one that you
expect to require removal or disabling from time to time, this module can
handle it for you.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.TransientSource.html" title="struct cosmic::cctk::sctk::reexports::calloop::transient::TransientSource">Transient<wbr>Source</a></dt><dd>A <a href="struct.TransientSource.html" title="struct cosmic::cctk::sctk::reexports::calloop::transient::TransientSource"><code>TransientSource</code></a> wraps a Calloop event source and manages its
registration. A user of this type only needs to perform the usual Calloop
calls (<code>process_events()</code> and <code>*register()</code>) and the return value of
<a href="../trait.EventSource.html#tymethod.process_events" title="method cosmic::cctk::sctk::reexports::calloop::EventSource::process_events"><code>process_events()</code></a>.</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["TransientSource"]};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
<!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="`Result` alias using Calloop’s error type."><title>Result in cosmic::cctk::sctk::reexports::calloop - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[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="../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Result</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.Err" title="Err">Err</a></li><li><a href="#variant.Ok" title="Ok">Ok</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>calloop</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">cosmic</a>::<wbr><a href="../../../index.html">cctk</a>::<wbr><a href="../../index.html">sctk</a>::<wbr><a href="../index.html">reexports</a>::<wbr><a href="index.html">calloop</a></div><h1>Type Alias <span class="type">Result</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type Result&lt;T&gt; = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="enum" href="enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a>&gt;;</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="type.Result.html" title="type cosmic::cctk::sctk::reexports::calloop::Result"><code>Result</code></a> alias using Calloop’s error type.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub enum Result&lt;T&gt; {
Ok(T),
Err(<a class="enum" href="enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a>),
}</code></pre><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.Ok" class="variant"><a href="#variant.Ok" class="anchor">§</a><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><h3 class="code-header">Ok(T)</h3></section><div class="docblock"><p>Contains the success value</p>
</div><section id="variant.Err" class="variant"><a href="#variant.Err" class="anchor">§</a><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><h3 class="code-header">Err(<a class="enum" href="enum.Error.html" title="enum cosmic::cctk::sctk::reexports::calloop::Error">Error</a>)</h3></section><div class="docblock"><p>Contains the error value</p>
</div></div><script src="../../../../../type.impl/core/result/enum.Result.js" data-self-path="cosmic::cctk::sctk::reexports::calloop::Result" async></script></section></div></main></body></html>

View file

@ -0,0 +1,25 @@
<!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="Utilities for using an `EventQueue` from wayland-client with an event loop that performs polling with `calloop`."><title>cosmic::cctk::sctk::reexports::calloop_wayland_source - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../../../../../crates.js"></script><script defer src="../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[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="../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">cosmic</a>::<wbr><a href="../../../index.html">cctk</a>::<wbr><a href="../../index.html">sctk</a>::<wbr><a href="../index.html">reexports</a></div><h1>Crate <span>calloop_wayland_source</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities for using an <a href="../client/struct.EventQueue.html" title="struct cosmic::cctk::sctk::reexports::client::EventQueue"><code>EventQueue</code></a> from wayland-client with an event loop
that performs polling with <a href="https://crates.io/crates/calloop"><code>calloop</code></a>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>calloop::EventLoop;
<span class="kw">use </span>calloop_wayland_source::WaylandSource;
<span class="kw">use </span>wayland_client::{Connection, QueueHandle};
<span class="comment">// Create a Wayland connection and a queue.
</span><span class="kw">let </span>connection = Connection::connect_to_env().unwrap();
<span class="kw">let </span>event_queue = connection.new_event_queue();
<span class="kw">let </span>queue_handle = event_queue.handle();
<span class="comment">// Create the calloop event loop to drive everytihng.
</span><span class="kw">let </span><span class="kw-2">mut </span>event_loop: EventLoop&lt;()&gt; = EventLoop::try_new().unwrap();
<span class="kw">let </span>loop_handle = event_loop.handle();
<span class="comment">// Insert the wayland source into the calloop's event loop.
</span>WaylandSource::new(connection, event_queue).insert(loop_handle).unwrap();
<span class="comment">// This will start dispatching the event loop and processing pending wayland requests.
</span><span class="kw">while let </span><span class="prelude-val">Ok</span>(<span class="kw">_</span>) = event_loop.dispatch(<span class="prelude-val">None</span>, <span class="kw-2">&amp;mut </span>()) {
<span class="comment">// Your logic here.
</span>}</code></pre></div>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.WaylandSource.html" title="struct cosmic::cctk::sctk::reexports::calloop_wayland_source::WaylandSource">Wayland<wbr>Source</a></dt><dd>An adapter to insert an <a href="../client/struct.EventQueue.html" title="struct cosmic::cctk::sctk::reexports::client::EventQueue"><code>EventQueue</code></a> into a calloop
<a href="../calloop/struct.EventLoop.html" title="struct cosmic::cctk::sctk::reexports::calloop::EventLoop"><code>EventLoop</code></a>.</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["WaylandSource"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
<!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="Backend reexports"><title>cosmic::cctk::sctk::reexports::client::backend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../static.files/favicon-044be391.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="../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module backend</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">cosmic</a>::<wbr><a href="../../../../index.html">cctk</a>::<wbr><a href="../../../index.html">sctk</a>::<wbr><a href="../../index.html">reexports</a>::<wbr><a href="../index.html">client</a></div><h1>Module <span>backend</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Backend reexports</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="protocol/index.html" title="mod cosmic::cctk::sctk::reexports::client::backend::protocol">protocol</a></dt><dd>Types and utilities for manipulating the Wayland protocol</dd><dt><a class="mod" href="smallvec/index.html" title="mod cosmic::cctk::sctk::reexports::client::backend::smallvec">smallvec</a></dt><dd>Small vectors in various sizes. These store a certain number of elements inline, and fall back
to the heap for larger allocations. This can be a useful optimization for improving cache
locality and reducing allocator traffic for workloads that fit within the inline buffer.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Backend.html" title="struct cosmic::cctk::sctk::reexports::client::backend::Backend">Backend</a></dt><dd>A Wayland client backend</dd><dt><a class="struct" href="struct.InvalidId.html" title="struct cosmic::cctk::sctk::reexports::client::backend::InvalidId">Invalid<wbr>Id</a></dt><dd>An error generated when trying to act on an invalid <code>ObjectId</code>.</dd><dt><a class="struct" href="struct.NoWaylandLib.html" title="struct cosmic::cctk::sctk::reexports::client::backend::NoWaylandLib">NoWayland<wbr>Lib</a></dt><dd>An error type representing the failure to load libwayland</dd><dt><a class="struct" href="struct.ObjectId.html" title="struct cosmic::cctk::sctk::reexports::client::backend::ObjectId">Object<wbr>Id</a></dt><dd>An ID representing a Wayland object</dd><dt><a class="struct" href="struct.ReadEventsGuard.html" title="struct cosmic::cctk::sctk::reexports::client::backend::ReadEventsGuard">Read<wbr>Events<wbr>Guard</a></dt><dd>Guard for synchronizing event reading across multiple threads</dd><dt><a class="struct" href="struct.WeakBackend.html" title="struct cosmic::cctk::sctk::reexports::client::backend::WeakBackend">Weak<wbr>Backend</a></dt><dd>A weak handle to a <a href="struct.Backend.html" title="struct cosmic::cctk::sctk::reexports::client::backend::Backend"><code>Backend</code></a></dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.WaylandError.html" title="enum cosmic::cctk::sctk::reexports::client::backend::WaylandError">Wayland<wbr>Error</a></dt><dd>An error that can occur when using a Wayland connection</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.ObjectData.html" title="trait cosmic::cctk::sctk::reexports::client::backend::ObjectData">Object<wbr>Data</a></dt><dd>A trait representing your data associated to an object</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1,4 @@
<!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="Number of arguments that are stocked inline in a `Message` before allocating"><title>INLINE_ARGS in cosmic::cctk::sctk::reexports::client::backend::protocol - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../" data-static-root-path="../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[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="../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>protocol</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../index.html">cctk</a>::<wbr><a href="../../../../index.html">sctk</a>::<wbr><a href="../../../index.html">reexports</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">backend</a>::<wbr><a href="index.html">protocol</a></div><h1>Constant <span class="constant">INLINE_ARGS</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub const INLINE_ARGS: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 4; // 4usize</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Number of arguments that are stocked inline in a <code>Message</code> before allocating</p>
<p>This is a ad-hoc number trying to reach a good balance between avoiding too many allocations
and keeping the stack size of <code>Message</code> small.</p>
</div></details></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
<!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="Returns true if the two interfaces are the same."><title>same_interface in cosmic::cctk::sctk::reexports::client::backend::protocol - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../" data-static-root-path="../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>protocol</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../index.html">cctk</a>::<wbr><a href="../../../../index.html">sctk</a>::<wbr><a href="../../../index.html">reexports</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">backend</a>::<wbr><a href="index.html">protocol</a></div><h1>Function <span class="fn">same_interface</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub fn same_interface(a: &amp;'static <a class="struct" href="struct.Interface.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::Interface">Interface</a>, b: &amp;'static <a class="struct" href="struct.Interface.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::Interface">Interface</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns true if the two interfaces are the same.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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="Types and utilities for manipulating the Wayland protocol"><title>cosmic::cctk::sctk::reexports::client::backend::protocol - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../" data-static-root-path="../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../static.files/favicon-044be391.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="../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module protocol</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#statics" title="Statics">Statics</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#unions" title="Unions">Unions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../index.html">cctk</a>::<wbr><a href="../../../../index.html">sctk</a>::<wbr><a href="../../../index.html">reexports</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">backend</a></div><h1>Module <span>protocol</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Types and utilities for manipulating the Wayland protocol</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Interface.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::Interface">Interface</a></dt><dd>Description of wayland interface.</dd><dt><a class="struct" href="struct.Message.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::Message">Message</a></dt><dd>Represents a message that has been sent from some object.</dd><dt><a class="struct" href="struct.MessageDesc.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::MessageDesc">Message<wbr>Desc</a></dt><dd>Wire metadata of a given message</dd><dt><a class="struct" href="struct.ObjectInfo.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::ObjectInfo">Object<wbr>Info</a></dt><dd>Description of the protocol-level information of an object</dd><dt><a class="struct" href="struct.ProtocolError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::ProtocolError">Protocol<wbr>Error</a></dt><dd>A protocol error</dd><dt><a class="struct" href="struct.WEnumError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::WEnumError">WEnum<wbr>Error</a></dt><dd>Error representing an unknown numeric variant for a <a href="../../enum.WEnum.html" title="enum cosmic::cctk::sctk::reexports::client::WEnum"><code>WEnum</code></a></dd><dt><a class="struct" href="struct.wl_interface.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::wl_interface">wl_<wbr>interface</a></dt><dt><a class="struct" href="struct.wl_message.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::wl_message">wl_<wbr>message</a></dt></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.AllowNull.html" title="enum cosmic::cctk::sctk::reexports::client::backend::protocol::AllowNull">Allow<wbr>Null</a></dt><dd>Describes whether an argument may have a null value.</dd><dt><a class="enum" href="enum.Argument.html" title="enum cosmic::cctk::sctk::reexports::client::backend::protocol::Argument">Argument</a></dt><dd>Enum of possible argument of the protocol</dd><dt><a class="enum" href="enum.ArgumentType.html" title="enum cosmic::cctk::sctk::reexports::client::backend::protocol::ArgumentType">Argument<wbr>Type</a></dt><dd>Enum of possible argument types as recognized by the wire</dd><dt><a class="enum" href="enum.WEnum.html" title="enum cosmic::cctk::sctk::reexports::client::backend::protocol::WEnum">WEnum</a></dt><dd>An enum value in the protocol.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.INLINE_ARGS.html" title="constant cosmic::cctk::sctk::reexports::client::backend::protocol::INLINE_ARGS">INLINE_<wbr>ARGS</a></dt><dd>Number of arguments that are stocked inline in a <code>Message</code> before allocating</dd></dl><h2 id="statics" class="section-header">Statics<a href="#statics" class="anchor">§</a></h2><dl class="item-table"><dt><a class="static" href="static.ANONYMOUS_INTERFACE.html" title="static cosmic::cctk::sctk::reexports::client::backend::protocol::ANONYMOUS_INTERFACE">ANONYMOUS_<wbr>INTERFACE</a></dt><dd>Special interface representing an anonymous object</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.same_interface.html" title="fn cosmic::cctk::sctk::reexports::client::backend::protocol::same_interface">same_<wbr>interface</a></dt><dd>Returns true if the two interfaces are the same.</dd></dl><h2 id="unions" class="section-header">Unions<a href="#unions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="union" href="union.wl_argument.html" title="union cosmic::cctk::sctk::reexports::client::backend::protocol::wl_argument">wl_<wbr>argument</a></dt></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"constant":["INLINE_ARGS"],"enum":["AllowNull","Argument","ArgumentType","WEnum"],"fn":["same_interface"],"static":["ANONYMOUS_INTERFACE"],"struct":["Interface","Message","MessageDesc","ObjectInfo","ProtocolError","WEnumError","wl_interface","wl_message"],"union":["wl_argument"]};

View file

@ -0,0 +1,2 @@
<!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="Special interface representing an anonymous object"><title>ANONYMOUS_INTERFACE in cosmic::cctk::sctk::reexports::client::backend::protocol - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../" data-static-root-path="../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc static"><!--[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="../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>protocol</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../index.html">cctk</a>::<wbr><a href="../../../../index.html">sctk</a>::<wbr><a href="../../../index.html">reexports</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">backend</a>::<wbr><a href="index.html">protocol</a></div><h1>Static <span class="static">ANONYMOUS_INTERFACE</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub static ANONYMOUS_INTERFACE: <a class="struct" href="struct.Interface.html" title="struct cosmic::cctk::sctk::reexports::client::backend::protocol::Interface">Interface</a></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Special interface representing an anonymous object</p>
</div></details></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["WaylandError"],"mod":["protocol","smallvec"],"struct":["Backend","InvalidId","NoWaylandLib","ObjectId","ReadEventsGuard","WeakBackend"],"trait":["ObjectData"]};

View file

@ -0,0 +1,24 @@
<!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="Allocates memory with the global allocator."><title>alloc in cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">alloc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a>::<wbr><a href="index.html">alloc</a></div><h1>Function <span class="fn">alloc</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/alloc.rs.html#88">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn alloc(layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Allocates memory with the global allocator.</p>
<p>This function forwards calls to the <a href="trait.GlobalAlloc.html#tymethod.alloc" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::alloc"><code>GlobalAlloc::alloc</code></a> method
of the allocator registered with the <code>#[global_allocator]</code> attribute
if there is one, or the <code>std</code> crate’s default.</p>
<p>This function is expected to be deprecated in favor of the <code>allocate</code> method
of the <a href="struct.Global.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Global"><code>Global</code></a> type when it and the <a href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator"><code>Allocator</code></a> trait become stable.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>See <a href="trait.GlobalAlloc.html#tymethod.alloc" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::alloc"><code>GlobalAlloc::alloc</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::alloc::{alloc, dealloc, handle_alloc_error, Layout};
<span class="kw">unsafe </span>{
<span class="kw">let </span>layout = Layout::new::&lt;u16&gt;();
<span class="kw">let </span>ptr = alloc(layout);
<span class="kw">if </span>ptr.is_null() {
handle_alloc_error(layout);
}
<span class="kw-2">*</span>(ptr <span class="kw">as </span><span class="kw-2">*mut </span>u16) = <span class="number">42</span>;
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>(ptr <span class="kw">as </span><span class="kw-2">*mut </span>u16), <span class="number">42</span>);
dealloc(ptr, layout);
}</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,23 @@
<!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="Allocates zero-initialized memory with the global allocator."><title>alloc_zeroed in cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">alloc_<wbr>zeroed</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a>::<wbr><a href="index.html">alloc</a></div><h1>Function <span class="fn">alloc_zeroed</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/alloc.rs.html#171">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn alloc_zeroed(layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Allocates zero-initialized memory with the global allocator.</p>
<p>This function forwards calls to the <a href="trait.GlobalAlloc.html#method.alloc_zeroed" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::alloc_zeroed"><code>GlobalAlloc::alloc_zeroed</code></a> method
of the allocator registered with the <code>#[global_allocator]</code> attribute
if there is one, or the <code>std</code> crate’s default.</p>
<p>This function is expected to be deprecated in favor of the <code>allocate_zeroed</code> method
of the <a href="struct.Global.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Global"><code>Global</code></a> type when it and the <a href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator"><code>Allocator</code></a> trait become stable.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>See <a href="trait.GlobalAlloc.html#method.alloc_zeroed" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::alloc_zeroed"><code>GlobalAlloc::alloc_zeroed</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::alloc::{alloc_zeroed, dealloc, handle_alloc_error, Layout};
<span class="kw">unsafe </span>{
<span class="kw">let </span>layout = Layout::new::&lt;u16&gt;();
<span class="kw">let </span>ptr = alloc_zeroed(layout);
<span class="kw">if </span>ptr.is_null() {
handle_alloc_error(layout);
}
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>(ptr <span class="kw">as </span><span class="kw-2">*mut </span>u16), <span class="number">0</span>);
dealloc(ptr, layout);
}</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,9 @@
<!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="Deallocates memory with the global allocator."><title>dealloc in cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">dealloc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a>::<wbr><a href="index.html">alloc</a></div><h1>Function <span class="fn">dealloc</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/alloc.rs.html#113">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn dealloc(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>)</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Deallocates memory with the global allocator.</p>
<p>This function forwards calls to the <a href="trait.GlobalAlloc.html#tymethod.dealloc" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::dealloc"><code>GlobalAlloc::dealloc</code></a> method
of the allocator registered with the <code>#[global_allocator]</code> attribute
if there is one, or the <code>std</code> crate’s default.</p>
<p>This function is expected to be deprecated in favor of the <code>deallocate</code> method
of the <a href="struct.Global.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Global"><code>Global</code></a> type when it and the <a href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator"><code>Allocator</code></a> trait become stable.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>See <a href="trait.GlobalAlloc.html#tymethod.dealloc" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::dealloc"><code>GlobalAlloc::dealloc</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,22 @@
<!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="Signals a memory allocation error."><title>handle_alloc_error in cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a>::<wbr><a href="index.html">alloc</a></div><h1>Function <span class="fn">handle_alloc_error</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><span class="since" title="Stable since Rust version 1.36.0, const unstable">1.36.0 (const: <a href="https://github.com/rust-lang/rust/issues/92523" title="Tracking issue for const_alloc_error">unstable</a>)</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/alloc.rs.html#398">Source</a> </span></div><pre class="rust item-decl"><code>pub fn handle_alloc_error(layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.never.html">!</a></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Signals a memory allocation error.</p>
<p>Callers of memory allocation APIs wishing to cease execution
in response to an allocation error are encouraged to call this function,
rather than directly invoking <a href="https://doc.rust-lang.org/nightly/core/macro.panic.html" title="macro core::panic"><code>panic!</code></a> or similar.</p>
<p>This function is guaranteed to diverge (not return normally with a value), but depending on
global configuration, it may either panic (resulting in unwinding or aborting as per
configuration for all panics), or abort the process (with no unwinding).</p>
<p>The default behavior is:</p>
<ul>
<li>
<p>If the binary links against <code>std</code> (typically the case), then
print a message to standard error and abort the process.
This behavior can be replaced with <a href="../../std/alloc/fn.set_alloc_error_hook.html"><code>set_alloc_error_hook</code></a> and <a href="../../std/alloc/fn.take_alloc_error_hook.html"><code>take_alloc_error_hook</code></a>.
Future versions of Rust may panic by default instead.</p>
</li>
<li>
<p>If the binary does not link against <code>std</code> (all of its crates are marked
<a href="https://doc.rust-lang.org/reference/names/preludes.html#the-no_std-attribute"><code>#![no_std]</code></a>), then call <a href="https://doc.rust-lang.org/nightly/core/macro.panic.html" title="macro core::panic"><code>panic!</code></a> with a message.
<a href="https://doc.rust-lang.org/reference/runtime.html#the-panic_handler-attribute">The panic handler</a> applies as to any panic.</p>
</li>
</ul>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,9 @@
<!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="Reallocates memory with the global allocator."><title>realloc in cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">realloc</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a>::<wbr><a href="index.html">alloc</a></div><h1>Function <span class="fn">realloc</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/alloc.rs.html#133">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn realloc(ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>, new_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reallocates memory with the global allocator.</p>
<p>This function forwards calls to the <a href="trait.GlobalAlloc.html#method.realloc" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::realloc"><code>GlobalAlloc::realloc</code></a> method
of the allocator registered with the <code>#[global_allocator]</code> attribute
if there is one, or the <code>std</code> crate’s default.</p>
<p>This function is expected to be deprecated in favor of the <code>grow</code> and <code>shrink</code> methods
of the <a href="struct.Global.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Global"><code>Global</code></a> type when it and the <a href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator"><code>Allocator</code></a> trait become stable.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>See <a href="trait.GlobalAlloc.html#method.realloc" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc::realloc"><code>GlobalAlloc::realloc</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,10 @@
<!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="Memory allocation APIs"><title>cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module alloc</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a></div><h1>Module <span>alloc</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="src" href="https://doc.rust-lang.org/nightly/src/alloc/lib.rs.html#209">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Memory allocation APIs</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a></dt><dd>Layout of a block of memory.</dd><dt><a class="struct" href="struct.LayoutError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::LayoutError">Layout<wbr>Error</a></dt><dd>The <code>LayoutError</code> is returned when the parameters given
to <code>Layout::from_size_align</code>
or some other <code>Layout</code> constructor
do not satisfy its documented constraints.</dd><dt><a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">Alloc<wbr>Error</a><wbr><span class="stab unstable" title="">Experimental</span></dt><dd>The <code>AllocError</code> error indicates an allocation failure
that may be due to resource exhaustion or to
something wrong when combining the given input arguments with this
allocator.</dd><dt><a class="struct" href="struct.Global.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Global">Global</a><wbr><span class="stab unstable" title="">Experimental</span></dt><dd>The global memory allocator.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.GlobalAlloc.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc">Global<wbr>Alloc</a></dt><dd>A memory allocator that can be registered as the standard library’s default
through the <code>#[global_allocator]</code> attribute.</dd><dt><a class="trait" href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator">Allocator</a><wbr><span class="stab unstable" title="">Experimental</span></dt><dd>An implementation of <code>Allocator</code> can allocate, grow, shrink, and deallocate arbitrary blocks of
data described via <a href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout"><code>Layout</code></a>.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.alloc.html" title="fn cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::alloc">alloc</a><sup title="unsafe function">⚠</sup></dt><dd>Allocates memory with the global allocator.</dd><dt><a class="fn" href="fn.alloc_zeroed.html" title="fn cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::alloc_zeroed">alloc_<wbr>zeroed</a><sup title="unsafe function">⚠</sup></dt><dd>Allocates zero-initialized memory with the global allocator.</dd><dt><a class="fn" href="fn.dealloc.html" title="fn cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::dealloc">dealloc</a><sup title="unsafe function">⚠</sup></dt><dd>Deallocates memory with the global allocator.</dd><dt><a class="fn" href="fn.handle_alloc_error.html" title="fn cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::handle_alloc_error">handle_<wbr>alloc_<wbr>error</a></dt><dd>Signals a memory allocation error.</dd><dt><a class="fn" href="fn.realloc.html" title="fn cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::realloc">realloc</a><sup title="unsafe function">⚠</sup></dt><dd>Reallocates memory with the global allocator.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.LayoutErr.html" title="type cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::LayoutErr">Layout<wbr>Err</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["alloc","alloc_zeroed","dealloc","handle_alloc_error","realloc"],"struct":["AllocError","Global","Layout","LayoutError"],"trait":["Allocator","GlobalAlloc"],"type":["LayoutErr"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,203 @@
<!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="An implementation of `Allocator` can allocate, grow, shrink, and deallocate arbitrary blocks of data described via `Layout`."><title>Allocator in cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../../../../../../" data-static-root-path="../../../../../../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../../../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../../../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[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="../../../../../../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Allocator</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#currently-allocated-memory" title="Currently allocated memory">Currently allocated memory</a></li><li><a href="#memory-fitting" title="Memory fitting">Memory fitting</a></li><li><a href="#safety" title="Safety">Safety</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.allocate" title="allocate">allocate</a></li><li><a href="#tymethod.deallocate" title="deallocate">deallocate</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.allocate_zeroed" title="allocate_zeroed">allocate_zeroed</a></li><li><a href="#method.by_ref" title="by_ref">by_ref</a></li><li><a href="#method.grow" title="grow">grow</a></li><li><a href="#method.grow_zeroed" title="grow_zeroed">grow_zeroed</a></li><li><a href="#method.shrink" title="shrink">shrink</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>reexports::<wbr>client::<wbr>backend::<wbr>smallvec::<wbr>alloc::<wbr>alloc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../../../../index.html">cosmic</a>::<wbr><a href="../../../../../../../index.html">cctk</a>::<wbr><a href="../../../../../../index.html">sctk</a>::<wbr><a href="../../../../../index.html">reexports</a>::<wbr><a href="../../../../index.html">client</a>::<wbr><a href="../../../index.html">backend</a>::<wbr><a href="../../index.html">smallvec</a>::<wbr><a href="../index.html">alloc</a>::<wbr><a href="index.html">alloc</a></div><h1>Trait <span class="trait">Allocator</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#105">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe trait Allocator {
// Required methods
fn <a href="#tymethod.allocate" class="fn">allocate</a>(&amp;self, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt;;
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.deallocate" class="fn">deallocate</a>(&amp;self, ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>);
// Provided methods
fn <a href="#method.allocate_zeroed" class="fn">allocate_zeroed</a>(
&amp;self,
layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt; { ... }
<span class="item-spacer"></span> unsafe fn <a href="#method.grow" class="fn">grow</a>(
&amp;self,
ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;,
old_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
new_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt; { ... }
<span class="item-spacer"></span> unsafe fn <a href="#method.grow_zeroed" class="fn">grow_zeroed</a>(
&amp;self,
ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;,
old_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
new_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt; { ... }
<span class="item-spacer"></span> unsafe fn <a href="#method.shrink" class="fn">shrink</a>(
&amp;self,
ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;,
old_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
new_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.by_ref" class="fn">by_ref</a>(&amp;self) -&gt; &amp;Self
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
}</code></pre><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div><div class="stab portability">Available on <strong>crate feature <code>wayland</code> and Linux</strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An implementation of <code>Allocator</code> can allocate, grow, shrink, and deallocate arbitrary blocks of
data described via <a href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout"><code>Layout</code></a>.</p>
<p><code>Allocator</code> is designed to be implemented on ZSTs, references, or smart pointers.
An allocator for <code>MyAlloc([u8; N])</code> cannot be moved, without updating the pointers to the
allocated memory.</p>
<p>In contrast to <a href="trait.GlobalAlloc.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::GlobalAlloc"><code>GlobalAlloc</code></a>, <code>Allocator</code> allows zero-sized allocations. If an underlying
allocator does not support this (like jemalloc) or responds by returning a null pointer
(such as <code>libc::malloc</code>), this must be caught by the implementation.</p>
<h4 id="currently-allocated-memory"><a class="doc-anchor" href="#currently-allocated-memory">§</a>Currently allocated memory</h4>
<p>Some of the methods require that a memory block is <em>currently allocated</em> by an allocator.
This means that:</p>
<ul>
<li>the starting address for that memory block was previously
returned by <a href="trait.Allocator.html#tymethod.allocate" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::allocate"><code>allocate</code></a>, <a href="trait.Allocator.html#method.grow" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::grow"><code>grow</code></a>, or <a href="trait.Allocator.html#method.shrink" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::shrink"><code>shrink</code></a>, and</li>
<li>the memory block has not subsequently been deallocated.</li>
</ul>
<p>A memory block is deallocated by a call to <a href="trait.Allocator.html#tymethod.deallocate" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::deallocate"><code>deallocate</code></a>,
or by a call to <a href="trait.Allocator.html#method.grow" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::grow"><code>grow</code></a> or <a href="trait.Allocator.html#method.shrink" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::shrink"><code>shrink</code></a> that returns <code>Ok</code>.
A call to <code>grow</code> or <code>shrink</code> that returns <code>Err</code>,
does not deallocate the memory block passed to it.</p>
<h4 id="memory-fitting"><a class="doc-anchor" href="#memory-fitting">§</a>Memory fitting</h4>
<p>Some of the methods require that a <code>layout</code> <em>fit</em> a memory block or vice versa. This means that the
following conditions must hold:</p>
<ul>
<li>the memory block must be <em>currently allocated</em> with alignment of <a href="struct.Layout.html#method.align" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout::align"><code>layout.align()</code></a>, and</li>
<li><a href="struct.Layout.html#method.size" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout::size"><code>layout.size()</code></a> must fall in the range <code>min ..= max</code>, where:
<ul>
<li><code>min</code> is the size of the layout used to allocate the block, and</li>
<li><code>max</code> is the actual size returned from <a href="trait.Allocator.html#tymethod.allocate" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::allocate"><code>allocate</code></a>, <a href="trait.Allocator.html#method.grow" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::grow"><code>grow</code></a>, or <a href="trait.Allocator.html#method.shrink" title="method cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator::shrink"><code>shrink</code></a>.</li>
</ul>
</li>
</ul>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>Memory blocks that are <a href="#currently-allocated-memory"><em>currently allocated</em></a> by an allocator,
must point to valid memory, and retain their validity until either:</p>
<ul>
<li>the memory block is deallocated, or</li>
<li>the allocator is dropped.</li>
</ul>
<p>Copying, cloning, or moving the allocator must not invalidate memory blocks returned from it.
A copied or cloned allocator must behave like the original allocator.</p>
<p>A memory block which is <a href="#currently-allocated-memory"><em>currently allocated</em></a> may be passed to
any method of the allocator that accepts such an argument.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.allocate" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#132">Source</a><h4 class="code-header">fn <a href="#tymethod.allocate" class="fn">allocate</a>(&amp;self, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Attempts to allocate a block of memory.</p>
<p>On success, returns a <a href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull"><code>NonNull&lt;[u8]&gt;</code></a> meeting the size and alignment guarantees of <code>layout</code>.</p>
<p>The returned block may have a larger size than specified by <code>layout.size()</code>, and may or may
not have its contents initialized.</p>
<p>The returned block of memory remains valid as long as it is <a href="#currently-allocated-memory"><em>currently allocated</em></a> and the shorter of:</p>
<ul>
<li>the borrow-checker lifetime of the allocator type itself.</li>
<li>as long as the allocator and all its clones have not been dropped.</li>
</ul>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>Returning <code>Err</code> indicates that either memory is exhausted or <code>layout</code> does not meet
allocator’s size or alignment constraints.</p>
<p>Implementations are encouraged to return <code>Err</code> on memory exhaustion rather than panicking or
aborting, but this is not a strict requirement. (Specifically: it is <em>legal</em> to implement
this trait atop an underlying native allocation library that aborts on memory exhaustion.)</p>
<p>Clients wishing to abort computation in response to an allocation error are encouraged to
call the <a href="../../alloc/alloc/fn.handle_alloc_error.html"><code>handle_alloc_error</code></a> function, rather than directly invoking <code>panic!</code> or similar.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.deallocate" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#165">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.deallocate" class="fn">deallocate</a>(&amp;self, ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>)</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Deallocates the memory referenced by <code>ptr</code>.</p>
<h5 id="safety-1"><a class="doc-anchor" href="#safety-1">§</a>Safety</h5>
<ul>
<li><code>ptr</code> must denote a block of memory <a href="#currently-allocated-memory"><em>currently allocated</em></a> via this allocator, and</li>
<li><code>layout</code> must <a href="#memory-fitting"><em>fit</em></a> that block of memory.</li>
</ul>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.allocate_zeroed" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#149">Source</a><h4 class="code-header">fn <a href="#method.allocate_zeroed" class="fn">allocate_zeroed</a>(&amp;self, layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Behaves like <code>allocate</code>, but also ensures that the returned memory is zero-initialized.</p>
<h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
<p>Returning <code>Err</code> indicates that either memory is exhausted or <code>layout</code> does not meet
allocator’s size or alignment constraints.</p>
<p>Implementations are encouraged to return <code>Err</code> on memory exhaustion rather than panicking or
aborting, but this is not a strict requirement. (Specifically: it is <em>legal</em> to implement
this trait atop an underlying native allocation library that aborts on memory exhaustion.)</p>
<p>Clients wishing to abort computation in response to an allocation error are encouraged to
call the <a href="../../alloc/alloc/fn.handle_alloc_error.html"><code>handle_alloc_error</code></a> function, rather than directly invoking <code>panic!</code> or similar.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.grow" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#205-210">Source</a><h4 class="code-header">unsafe fn <a href="#method.grow" class="fn">grow</a>(
&amp;self,
ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;,
old_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
new_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Attempts to extend the memory block.</p>
<p>Returns a new <a href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull"><code>NonNull&lt;[u8]&gt;</code></a> containing a pointer and the actual size of the allocated
memory. The pointer is suitable for holding data described by <code>new_layout</code>. To accomplish
this, the allocator may extend the allocation referenced by <code>ptr</code> to fit the new layout.</p>
<p>If this returns <code>Ok</code>, then ownership of the memory block referenced by <code>ptr</code> has been
transferred to this allocator. Any access to the old <code>ptr</code> is Undefined Behavior, even if the
allocation was grown in-place. The newly returned pointer is the only valid pointer
for accessing this memory now.</p>
<p>If this method returns <code>Err</code>, then ownership of the memory block has not been transferred to
this allocator, and the contents of the memory block are unaltered.</p>
<h5 id="safety-2"><a class="doc-anchor" href="#safety-2">§</a>Safety</h5>
<ul>
<li><code>ptr</code> must denote a block of memory <a href="#currently-allocated-memory"><em>currently allocated</em></a> via this allocator.</li>
<li><code>old_layout</code> must <a href="#memory-fitting"><em>fit</em></a> that block of memory (The <code>new_layout</code> argument need not fit it.).</li>
<li><code>new_layout.size()</code> must be greater than or equal to <code>old_layout.size()</code>.</li>
</ul>
<p>Note that <code>new_layout.align()</code> need not be the same as <code>old_layout.align()</code>.</p>
<h5 id="errors-2"><a class="doc-anchor" href="#errors-2">§</a>Errors</h5>
<p>Returns <code>Err</code> if the new layout does not meet the allocator’s size and alignment
constraints of the allocator, or if growing otherwise fails.</p>
<p>Implementations are encouraged to return <code>Err</code> on memory exhaustion rather than panicking or
aborting, but this is not a strict requirement. (Specifically: it is <em>legal</em> to implement
this trait atop an underlying native allocation library that aborts on memory exhaustion.)</p>
<p>Clients wishing to abort computation in response to an allocation error are encouraged to
call the <a href="../../alloc/alloc/fn.handle_alloc_error.html"><code>handle_alloc_error</code></a> function, rather than directly invoking <code>panic!</code> or similar.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.grow_zeroed" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#268-273">Source</a><h4 class="code-header">unsafe fn <a href="#method.grow_zeroed" class="fn">grow_zeroed</a>(
&amp;self,
ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;,
old_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
new_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Behaves like <code>grow</code>, but also ensures that the new contents are set to zero before being
returned.</p>
<p>The memory block will contain the following contents after a successful call to
<code>grow_zeroed</code>:</p>
<ul>
<li>Bytes <code>0..old_layout.size()</code> are preserved from the original allocation.</li>
<li>Bytes <code>old_layout.size()..old_size</code> will either be preserved or zeroed, depending on
the allocator implementation. <code>old_size</code> refers to the size of the memory block prior
to the <code>grow_zeroed</code> call, which may be larger than the size that was originally
requested when it was allocated.</li>
<li>Bytes <code>old_size..new_size</code> are zeroed. <code>new_size</code> refers to the size of the memory
block returned by the <code>grow_zeroed</code> call.</li>
</ul>
<h5 id="safety-3"><a class="doc-anchor" href="#safety-3">§</a>Safety</h5>
<ul>
<li><code>ptr</code> must denote a block of memory <a href="#currently-allocated-memory"><em>currently allocated</em></a> via this allocator.</li>
<li><code>old_layout</code> must <a href="#memory-fitting"><em>fit</em></a> that block of memory (The <code>new_layout</code> argument need not fit it.).</li>
<li><code>new_layout.size()</code> must be greater than or equal to <code>old_layout.size()</code>.</li>
</ul>
<p>Note that <code>new_layout.align()</code> need not be the same as <code>old_layout.align()</code>.</p>
<h5 id="errors-3"><a class="doc-anchor" href="#errors-3">§</a>Errors</h5>
<p>Returns <code>Err</code> if the new layout does not meet the allocator’s size and alignment
constraints of the allocator, or if growing otherwise fails.</p>
<p>Implementations are encouraged to return <code>Err</code> on memory exhaustion rather than panicking or
aborting, but this is not a strict requirement. (Specifically: it is <em>legal</em> to implement
this trait atop an underlying native allocation library that aborts on memory exhaustion.)</p>
<p>Clients wishing to abort computation in response to an allocation error are encouraged to
call the <a href="../../alloc/alloc/fn.handle_alloc_error.html"><code>handle_alloc_error</code></a> function, rather than directly invoking <code>panic!</code> or similar.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.shrink" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#332-337">Source</a><h4 class="code-header">unsafe fn <a href="#method.shrink" class="fn">shrink</a>(
&amp;self,
ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;,
old_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
new_layout: <a class="struct" href="struct.Layout.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Layout">Layout</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;, <a class="struct" href="struct.AllocError.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::AllocError">AllocError</a>&gt;</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Attempts to shrink the memory block.</p>
<p>Returns a new <a href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull"><code>NonNull&lt;[u8]&gt;</code></a> containing a pointer and the actual size of the allocated
memory. The pointer is suitable for holding data described by <code>new_layout</code>. To accomplish
this, the allocator may shrink the allocation referenced by <code>ptr</code> to fit the new layout.</p>
<p>If this returns <code>Ok</code>, then ownership of the memory block referenced by <code>ptr</code> has been
transferred to this allocator. Any access to the old <code>ptr</code> is Undefined Behavior, even if the
allocation was shrunk in-place. The newly returned pointer is the only valid pointer
for accessing this memory now.</p>
<p>If this method returns <code>Err</code>, then ownership of the memory block has not been transferred to
this allocator, and the contents of the memory block are unaltered.</p>
<h5 id="safety-4"><a class="doc-anchor" href="#safety-4">§</a>Safety</h5>
<ul>
<li><code>ptr</code> must denote a block of memory <a href="#currently-allocated-memory"><em>currently allocated</em></a> via this allocator.</li>
<li><code>old_layout</code> must <a href="#memory-fitting"><em>fit</em></a> that block of memory (The <code>new_layout</code> argument need not fit it.).</li>
<li><code>new_layout.size()</code> must be smaller than or equal to <code>old_layout.size()</code>.</li>
</ul>
<p>Note that <code>new_layout.align()</code> need not be the same as <code>old_layout.align()</code>.</p>
<h5 id="errors-4"><a class="doc-anchor" href="#errors-4">§</a>Errors</h5>
<p>Returns <code>Err</code> if the new layout does not meet the allocator’s size and alignment
constraints of the allocator, or if shrinking otherwise fails.</p>
<p>Implementations are encouraged to return <code>Err</code> on memory exhaustion rather than panicking or
aborting, but this is not a strict requirement. (Specifically: it is <em>legal</em> to implement
this trait atop an underlying native allocation library that aborts on memory exhaustion.)</p>
<p>Clients wishing to abort computation in response to an allocation error are encouraged to
call the <a href="../../alloc/alloc/fn.handle_alloc_error.html"><code>handle_alloc_error</code></a> function, rather than directly invoking <code>panic!</code> or similar.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.by_ref" class="method"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#362-364">Source</a><h4 class="code-header">fn <a href="#method.by_ref" class="fn">by_ref</a>(&amp;self) -&gt; &amp;Self<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>allocator_api</code>)</span></div></span></summary><div class="docblock"><p>Creates a “by reference” adapter for this instance of <code>Allocator</code>.</p>
<p>The returned adapter also implements <code>Allocator</code> and will simply borrow this.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Allocator-for-System" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/std/alloc.rs.html#204">Source</a><a href="#impl-Allocator-for-System" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator">Allocator</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/alloc/struct.System.html" title="struct std::alloc::System">System</a></h3></section><section id="impl-Allocator-for-Global" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/alloc/alloc.rs.html#246">Source</a><a href="#impl-Allocator-for-Global" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator">Allocator</a> for <a class="struct" href="struct.Global.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Global">Global</a></h3></section><section id="impl-Allocator-for-%26A" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/alloc/mod.rs.html#371-373">Source</a><a href="#impl-Allocator-for-%26A" class="anchor">§</a><h3 class="code-header">impl&lt;A&gt; <a class="trait" href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator">Allocator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;A</a><div class="where">where
A: <a class="trait" href="trait.Allocator.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator">Allocator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><script src="../../../../../../../../../trait.impl/core/alloc/trait.Allocator.js" data-ignore-extern-crates="std,alloc" async></script></section></div></main></body></html>

Some files were not shown because too many files have changed in this diff Show more