47 lines
No EOL
13 KiB
HTML
47 lines
No EOL
13 KiB
HTML
<!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 trait implemented by modular parts of a smithay’s client toolkit and protocol delegates that may be used to receive notification of a global being created or destroyed."><title>RegistryHandler in cosmic::cctk::sctk::registry - 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="#">Registry<wbr>Handler</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.new_global" title="new_global">new_global</a></li><li><a href="#method.remove_global" title="remove_global">remove_global</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cctk::<wbr>sctk::<wbr>registry</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">registry</a></div><h1>Trait <span class="trait">RegistryHandler</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 trait RegistryHandler<D><div class="where">where
|
||
D: <a class="trait" href="trait.ProvidesRegistryState.html" title="trait cosmic::cctk::sctk::registry::ProvidesRegistryState">ProvidesRegistryState</a>,</div>{
|
||
// Provided methods
|
||
fn <a href="#method.new_global" class="fn">new_global</a>(
|
||
data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut D</a>,
|
||
conn: &<a class="struct" href="../reexports/client/struct.Connection.html" title="struct cosmic::cctk::sctk::reexports::client::Connection">Connection</a>,
|
||
qh: &<a class="struct" href="../reexports/client/struct.QueueHandle.html" title="struct cosmic::cctk::sctk::reexports::client::QueueHandle">QueueHandle</a><D>,
|
||
name: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
|
||
interface: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
|
||
version: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
|
||
) { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.remove_global" class="fn">remove_global</a>(
|
||
data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut D</a>,
|
||
conn: &<a class="struct" href="../reexports/client/struct.Connection.html" title="struct cosmic::cctk::sctk::reexports::client::Connection">Connection</a>,
|
||
qh: &<a class="struct" href="../reexports/client/struct.QueueHandle.html" title="struct cosmic::cctk::sctk::reexports::client::QueueHandle">QueueHandle</a><D>,
|
||
name: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
|
||
interface: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</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>A trait implemented by modular parts of a smithay’s client toolkit and protocol delegates that may be used
|
||
to receive notification of a global being created or destroyed.</p>
|
||
<p>Delegates that choose to implement this trait may be used in <a href="../macro.registry_handlers.html" title="macro cosmic::cctk::sctk::registry_handlers"><code>registry_handlers</code></a> which
|
||
automatically notifies delegates about the creation and destruction of globals.</p>
|
||
<p>Note that in order to delegate registry handling to a type which implements this trait, your <code>D</code> data type
|
||
must implement <a href="trait.ProvidesRegistryState.html" title="trait cosmic::cctk::sctk::registry::ProvidesRegistryState"><code>ProvidesRegistryState</code></a>.</p>
|
||
</div></details><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.new_global" class="method"><h4 class="code-header">fn <a href="#method.new_global" class="fn">new_global</a>(
|
||
data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut D</a>,
|
||
conn: &<a class="struct" href="../reexports/client/struct.Connection.html" title="struct cosmic::cctk::sctk::reexports::client::Connection">Connection</a>,
|
||
qh: &<a class="struct" href="../reexports/client/struct.QueueHandle.html" title="struct cosmic::cctk::sctk::reexports::client::QueueHandle">QueueHandle</a><D>,
|
||
name: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
|
||
interface: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
|
||
version: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
|
||
)</h4></section></summary><div class="docblock"><p>Called when a new global has been advertised by the compositor.</p>
|
||
<p>The provided registry handle may be used to bind the global. This is not called during
|
||
initial enumeration of globals. It is primarily useful for multi-instance globals such as
|
||
<code>wl_output</code> and <code>wl_seat</code>.</p>
|
||
<p>The default implementation does nothing.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_global" class="method"><h4 class="code-header">fn <a href="#method.remove_global" class="fn">remove_global</a>(
|
||
data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut D</a>,
|
||
conn: &<a class="struct" href="../reexports/client/struct.Connection.html" title="struct cosmic::cctk::sctk::reexports::client::Connection">Connection</a>,
|
||
qh: &<a class="struct" href="../reexports/client/struct.QueueHandle.html" title="struct cosmic::cctk::sctk::reexports::client::QueueHandle">QueueHandle</a><D>,
|
||
name: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
|
||
interface: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
|
||
)</h4></section></summary><div class="docblock"><p>Called when a global has been destroyed by the compositor.</p>
|
||
<p>The default implementation does nothing.</p>
|
||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-RegistryHandler%3CD%3E-for-OutputState" class="impl"><a href="#impl-RegistryHandler%3CD%3E-for-OutputState" class="anchor">§</a><h3 class="code-header">impl<D> <a class="trait" href="trait.RegistryHandler.html" title="trait cosmic::cctk::sctk::registry::RegistryHandler">RegistryHandler</a><D> for <a class="struct" href="../output/struct.OutputState.html" title="struct cosmic::cctk::sctk::output::OutputState">OutputState</a><div class="where">where
|
||
D: <a class="trait" href="../reexports/client/trait.Dispatch.html" title="trait cosmic::cctk::sctk::reexports::client::Dispatch">Dispatch</a><<a class="struct" href="../reexports/client/protocol/wl_output/struct.WlOutput.html" title="struct cosmic::cctk::sctk::reexports::client::protocol::wl_output::WlOutput">WlOutput</a>, <a class="struct" href="../output/struct.OutputData.html" title="struct cosmic::cctk::sctk::output::OutputData">OutputData</a>> + <a class="trait" href="../reexports/client/trait.Dispatch.html" title="trait cosmic::cctk::sctk::reexports::client::Dispatch">Dispatch</a><<a class="struct" href="../reexports/protocols/xdg/xdg_output/zv1/client/zxdg_output_v1/struct.ZxdgOutputV1.html" title="struct cosmic::cctk::sctk::reexports::protocols::xdg::xdg_output::zv1::client::zxdg_output_v1::ZxdgOutputV1">ZxdgOutputV1</a>, <a class="struct" href="../output/struct.OutputData.html" title="struct cosmic::cctk::sctk::output::OutputData">OutputData</a>> + <a class="trait" href="../reexports/client/trait.Dispatch.html" title="trait cosmic::cctk::sctk::reexports::client::Dispatch">Dispatch</a><<a class="struct" href="../reexports/protocols/xdg/xdg_output/zv1/client/zxdg_output_manager_v1/struct.ZxdgOutputManagerV1.html" title="struct cosmic::cctk::sctk::reexports::protocols::xdg::xdg_output::zv1::client::zxdg_output_manager_v1::ZxdgOutputManagerV1">ZxdgOutputManagerV1</a>, <a class="struct" href="../globals/struct.GlobalData.html" title="struct cosmic::cctk::sctk::globals::GlobalData">GlobalData</a>> + <a class="trait" href="../output/trait.OutputHandler.html" title="trait cosmic::cctk::sctk::output::OutputHandler">OutputHandler</a> + <a class="trait" href="trait.ProvidesRegistryState.html" title="trait cosmic::cctk::sctk::registry::ProvidesRegistryState">ProvidesRegistryState</a> + 'static,</div></h3></section><section id="impl-RegistryHandler%3CD%3E-for-SeatState" class="impl"><a href="#impl-RegistryHandler%3CD%3E-for-SeatState" class="anchor">§</a><h3 class="code-header">impl<D> <a class="trait" href="trait.RegistryHandler.html" title="trait cosmic::cctk::sctk::registry::RegistryHandler">RegistryHandler</a><D> for <a class="struct" href="../seat/struct.SeatState.html" title="struct cosmic::cctk::sctk::seat::SeatState">SeatState</a><div class="where">where
|
||
D: <a class="trait" href="../reexports/client/trait.Dispatch.html" title="trait cosmic::cctk::sctk::reexports::client::Dispatch">Dispatch</a><<a class="struct" href="../reexports/client/protocol/wl_seat/struct.WlSeat.html" title="struct cosmic::cctk::sctk::reexports::client::protocol::wl_seat::WlSeat">WlSeat</a>, <a class="struct" href="../seat/struct.SeatData.html" title="struct cosmic::cctk::sctk::seat::SeatData">SeatData</a>> + <a class="trait" href="../seat/trait.SeatHandler.html" title="trait cosmic::cctk::sctk::seat::SeatHandler">SeatHandler</a> + <a class="trait" href="trait.ProvidesRegistryState.html" title="trait cosmic::cctk::sctk::registry::ProvidesRegistryState">ProvidesRegistryState</a> + 'static,</div></h3></section></div><script src="../../../../trait.impl/smithay_client_toolkit/registry/trait.RegistryHandler.js" data-ignore-extern-crates="smithay_client_toolkit" async></script></section></div></main></body></html> |