97 lines
No EOL
48 KiB
HTML
97 lines
No EOL
48 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="An interactive cross-platform COSMIC application."><title>Application in cosmic::app - 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="#">Application</a></h2><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.APP_ID" title="APP_ID">APP_ID</a></li></ul><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Executor" title="Executor">Executor</a></li><li><a href="#associatedtype.Flags" title="Flags">Flags</a></li><li><a href="#associatedtype.Message" title="Message">Message</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.core" title="core">core</a></li><li><a href="#tymethod.core_mut" title="core_mut">core_mut</a></li><li><a href="#tymethod.init" title="init">init</a></li><li><a href="#tymethod.view" title="view">view</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.context_drawer" title="context_drawer">context_drawer</a></li><li><a href="#method.dbus_activation" title="dbus_activation">dbus_activation</a></li><li><a href="#method.dbus_connection" title="dbus_connection">dbus_connection</a></li><li><a href="#method.dialog" title="dialog">dialog</a></li><li><a href="#method.footer" title="footer">footer</a></li><li><a href="#method.header_center" title="header_center">header_center</a></li><li><a href="#method.header_end" title="header_end">header_end</a></li><li><a href="#method.header_start" title="header_start">header_start</a></li><li><a href="#method.nav_bar" title="nav_bar">nav_bar</a></li><li><a href="#method.nav_context_menu" title="nav_context_menu">nav_context_menu</a></li><li><a href="#method.nav_model" title="nav_model">nav_model</a></li><li><a href="#method.on_app_exit" title="on_app_exit">on_app_exit</a></li><li><a href="#method.on_close_requested" title="on_close_requested">on_close_requested</a></li><li><a href="#method.on_context_drawer" title="on_context_drawer">on_context_drawer</a></li><li><a href="#method.on_escape" title="on_escape">on_escape</a></li><li><a href="#method.on_nav_context" title="on_nav_context">on_nav_context</a></li><li><a href="#method.on_nav_select" title="on_nav_select">on_nav_select</a></li><li><a href="#method.on_search" title="on_search">on_search</a></li><li><a href="#method.on_window_resize" title="on_window_resize">on_window_resize</a></li><li><a href="#method.style" title="style">style</a></li><li><a href="#method.subscription" title="subscription">subscription</a></li><li><a href="#method.system_theme_mode_update" title="system_theme_mode_update">system_theme_mode_update</a></li><li><a href="#method.system_theme_update" title="system_theme_update">system_theme_update</a></li><li><a href="#method.update" title="update">update</a></li><li><a href="#method.view_window" title="view_window">view_window</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>app</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">app</a></div><h1>Trait <span class="trait">Application</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="../../src/cosmic/app/mod.rs.html#323-509">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Application<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> + 'static,</div>{
|
||
type <a href="#associatedtype.Executor" class="associatedtype">Executor</a>: <a class="trait" href="../iced/trait.Executor.html" title="trait cosmic::iced::Executor">Executor</a>;
|
||
type <a href="#associatedtype.Flags" class="associatedtype">Flags</a>;
|
||
type <a href="#associatedtype.Message" class="associatedtype">Message</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/fmt/trait.Debug.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static;
|
||
|
||
const <a href="#associatedconstant.APP_ID" class="constant">APP_ID</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
||
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 29 methods</span></summary>
|
||
// Required methods
|
||
fn <a href="#tymethod.core" class="fn">core</a>(&self) -> &<a class="struct" href="../struct.Core.html" title="struct cosmic::Core">Core</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.core_mut" class="fn">core_mut</a>(&mut self) -> &mut <a class="struct" href="../struct.Core.html" title="struct cosmic::Core">Core</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.init" class="fn">init</a>(core: <a class="struct" href="../struct.Core.html" title="struct cosmic::Core">Core</a>, flags: Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Flags" title="type cosmic::Application::Flags">Flags</a>) -> (Self, <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>);
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.view" class="fn">view</a>(&self) -> <a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>;
|
||
|
||
// Provided methods
|
||
fn <a href="#method.context_drawer" class="fn">context_drawer</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="context_drawer/struct.ContextDrawer.html" title="struct cosmic::app::context_drawer::ContextDrawer">ContextDrawer</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.dialog" class="fn">dialog</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.footer" class="fn">footer</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.header_start" class="fn">header_start</a>(&self) -> <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> <a href="#" class="tooltip" data-notable-ty="Vec<Element<'_, Self::Message>>">ⓘ</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.header_center" class="fn">header_center</a>(&self) -> <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> <a href="#" class="tooltip" data-notable-ty="Vec<Element<'_, Self::Message>>">ⓘ</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.header_end" class="fn">header_end</a>(&self) -> <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> <a href="#" class="tooltip" data-notable-ty="Vec<Element<'_, Self::Message>>">ⓘ</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.nav_bar" class="fn">nav_bar</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, <a class="enum" href="../action/enum.Action.html" title="enum cosmic::action::Action">Action</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.nav_context_menu" class="fn">nav_context_menu</a>(
|
||
&self,
|
||
id: <a class="type" href="../widget/nav_bar/type.Id.html" title="type cosmic::widget::nav_bar::Id">Id</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="struct" href="../widget/menu/struct.Tree.html" title="struct cosmic::widget::menu::Tree">Tree</a><<a class="enum" href="../action/enum.Action.html" title="enum cosmic::action::Action">Action</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>>>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.nav_model" class="fn">nav_model</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="type" href="../widget/nav_bar/type.Model.html" title="type cosmic::widget::nav_bar::Model">Model</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_app_exit" class="fn">on_app_exit</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_close_requested" class="fn">on_close_requested</a>(&self, id: <a class="struct" href="../iced/window/struct.Id.html" title="struct cosmic::iced::window::Id">Id</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_context_drawer" class="fn">on_context_drawer</a>(&mut self) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_escape" class="fn">on_escape</a>(&mut self) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_nav_select" class="fn">on_nav_select</a>(&mut self, id: <a class="type" href="../widget/nav_bar/type.Id.html" title="type cosmic::widget::nav_bar::Id">Id</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_nav_context" class="fn">on_nav_context</a>(&mut self, id: <a class="type" href="../widget/nav_bar/type.Id.html" title="type cosmic::widget::nav_bar::Id">Id</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_search" class="fn">on_search</a>(&mut self) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.on_window_resize" class="fn">on_window_resize</a>(&mut self, id: <a class="struct" href="../iced/window/struct.Id.html" title="struct cosmic::iced::window::Id">Id</a>, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.subscription" class="fn">subscription</a>(&self) -> <a class="struct" href="../iced/struct.Subscription.html" title="struct cosmic::iced::Subscription">Subscription</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.update" class="fn">update</a>(&mut self, message: Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.system_theme_update" class="fn">system_theme_update</a>(
|
||
&mut self,
|
||
keys: &[&'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>],
|
||
new_theme: &<a class="struct" href="../cosmic_theme/struct.Theme.html" title="struct cosmic::cosmic_theme::Theme">Theme</a>,
|
||
) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.system_theme_mode_update" class="fn">system_theme_mode_update</a>(
|
||
&mut self,
|
||
keys: &[&'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>],
|
||
new_theme: &<a class="struct" href="../cosmic_theme/struct.ThemeMode.html" title="struct cosmic::cosmic_theme::ThemeMode">ThemeMode</a>,
|
||
) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.view_window" class="fn">view_window</a>(&self, id: <a class="struct" href="../iced/window/struct.Id.html" title="struct cosmic::iced::window::Id">Id</a>) -> <a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.style" class="fn">style</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../iced/daemon/program/graphics/core/theme/struct.Style.html" title="struct cosmic::iced::daemon::program::graphics::core::theme::Style">Style</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.dbus_activation" class="fn">dbus_activation</a>(&mut self, msg: <a class="struct" href="../dbus_activation/struct.Message.html" title="struct cosmic::dbus_activation::Message">Message</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.dbus_connection" class="fn">dbus_connection</a>(&mut self, conn: Connection) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>> { ... }
|
||
</details>}</code></pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>winit</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An interactive cross-platform COSMIC application.</p>
|
||
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.APP_ID" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#339">Source</a><h4 class="code-header">const <a href="#associatedconstant.APP_ID" class="constant">APP_ID</a>: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>An ID that uniquely identifies the application.
|
||
The standard is to pick an ID based on a reverse-domain name notation.
|
||
IE: <code>com.system76.Settings</code></p>
|
||
</div></details></div><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Executor" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#328">Source</a><h4 class="code-header">type <a href="#associatedtype.Executor" class="associatedtype">Executor</a>: <a class="trait" href="../iced/trait.Executor.html" title="trait cosmic::iced::Executor">Executor</a></h4></section></summary><div class="docblock"><p>Default async executor to use with the app.</p>
|
||
</div></details><details class="toggle" open><summary><section id="associatedtype.Flags" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#331">Source</a><h4 class="code-header">type <a href="#associatedtype.Flags" class="associatedtype">Flags</a></h4></section></summary><div class="docblock"><p>Argument received [<code>Application::new</code>].</p>
|
||
</div></details><details class="toggle" open><summary><section id="associatedtype.Message" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#334">Source</a><h4 class="code-header">type <a href="#associatedtype.Message" class="associatedtype">Message</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/fmt/trait.Debug.html" title="trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static</h4></section></summary><div class="docblock"><p>Message type specific to our app.</p>
|
||
</div></details></div><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.core" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#342">Source</a><h4 class="code-header">fn <a href="#tymethod.core" class="fn">core</a>(&self) -> &<a class="struct" href="../struct.Core.html" title="struct cosmic::Core">Core</a></h4></section></summary><div class="docblock"><p>Grants access to the COSMIC Core.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.core_mut" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#345">Source</a><h4 class="code-header">fn <a href="#tymethod.core_mut" class="fn">core_mut</a>(&mut self) -> &mut <a class="struct" href="../struct.Core.html" title="struct cosmic::Core">Core</a></h4></section></summary><div class="docblock"><p>Grants access to the COSMIC Core.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.init" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#348">Source</a><h4 class="code-header">fn <a href="#tymethod.init" class="fn">init</a>(core: <a class="struct" href="../struct.Core.html" title="struct cosmic::Core">Core</a>, flags: Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Flags" title="type cosmic::Application::Flags">Flags</a>) -> (Self, <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>)</h4></section></summary><div class="docblock"><p>Creates the application, and optionally emits task on initialize.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.view" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#484">Source</a><h4 class="code-header">fn <a href="#tymethod.view" class="fn">view</a>(&self) -> <a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Constructs the view for the main window.</p>
|
||
</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.context_drawer" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#352-354">Source</a><h4 class="code-header">fn <a href="#method.context_drawer" class="fn">context_drawer</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="context_drawer/struct.ContextDrawer.html" title="struct cosmic::app::context_drawer::ContextDrawer">ContextDrawer</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>></h4></section></summary><div class="docblock"><p>Displays a context drawer on the side of the application window when <code>Some</code>.
|
||
Use the <a href="../trait.ApplicationExt.html#method.set_show_context" title="method cosmic::ApplicationExt::set_show_context"><code>ApplicationExt::set_show_context</code></a> function for this to take effect.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.dialog" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#357-359">Source</a><h4 class="code-header">fn <a href="#method.dialog" class="fn">dialog</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>></h4></section></summary><div class="docblock"><p>Displays a dialog in the center of the application window when <code>Some</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.footer" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#362-364">Source</a><h4 class="code-header">fn <a href="#method.footer" class="fn">footer</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>></h4></section></summary><div class="docblock"><p>Displays a footer at the bottom of the application window when <code>Some</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.header_start" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#367-369">Source</a><h4 class="code-header">fn <a href="#method.header_start" class="fn">header_start</a>(&self) -> <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> <a href="#" class="tooltip" data-notable-ty="Vec<Element<'_, Self::Message>>">ⓘ</a></h4></section></summary><div class="docblock"><p>Attaches elements to the start section of the header.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.header_center" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#372-374">Source</a><h4 class="code-header">fn <a href="#method.header_center" class="fn">header_center</a>(&self) -> <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> <a href="#" class="tooltip" data-notable-ty="Vec<Element<'_, Self::Message>>">ⓘ</a></h4></section></summary><div class="docblock"><p>Attaches elements to the center of the header.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.header_end" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#377-379">Source</a><h4 class="code-header">fn <a href="#method.header_end" class="fn">header_end</a>(&self) -> <a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>> <a href="#" class="tooltip" data-notable-ty="Vec<Element<'_, Self::Message>>">ⓘ</a></h4></section></summary><div class="docblock"><p>Attaches elements to the end section of the header.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.nav_bar" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#382-402">Source</a><h4 class="code-header">fn <a href="#method.nav_bar" class="fn">nav_bar</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, <a class="enum" href="../action/enum.Action.html" title="enum cosmic::action::Action">Action</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>>></h4></section></summary><div class="docblock"><p>Allows overriding the default nav bar widget.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.nav_context_menu" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#405-410">Source</a><h4 class="code-header">fn <a href="#method.nav_context_menu" class="fn">nav_context_menu</a>(&self, id: <a class="type" href="../widget/nav_bar/type.Id.html" title="type cosmic::widget::nav_bar::Id">Id</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a><<a class="struct" href="../widget/menu/struct.Tree.html" title="struct cosmic::widget::menu::Tree">Tree</a><<a class="enum" href="../action/enum.Action.html" title="enum cosmic::action::Action">Action</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>>>>></h4></section></summary><div class="docblock"><p>Shows a context menu for the active nav bar item.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.nav_model" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#413-415">Source</a><h4 class="code-header">fn <a href="#method.nav_model" class="fn">nav_model</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="type" href="../widget/nav_bar/type.Model.html" title="type cosmic::widget::nav_bar::Model">Model</a>></h4></section></summary><div class="docblock"><p>Allows COSMIC to integrate with your application’s <a href="../widget/nav_bar/type.Model.html" title="type cosmic::widget::nav_bar::Model"><code>nav_bar::Model</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_app_exit" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#418-420">Source</a><h4 class="code-header">fn <a href="#method.on_app_exit" class="fn">on_app_exit</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Called before closing the application. Returning a message will override closing windows.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_close_requested" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#423-425">Source</a><h4 class="code-header">fn <a href="#method.on_close_requested" class="fn">on_close_requested</a>(&self, id: <a class="struct" href="../iced/window/struct.Id.html" title="struct cosmic::iced::window::Id">Id</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Called when a window requests to be closed.</p>
|
||
</div></details><section id="method.on_context_drawer" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#428-430">Source</a><h4 class="code-header">fn <a href="#method.on_context_drawer" class="fn">on_context_drawer</a>(&mut self) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section><details class="toggle method-toggle" open><summary><section id="method.on_escape" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#433-435">Source</a><h4 class="code-header">fn <a href="#method.on_escape" class="fn">on_escape</a>(&mut self) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Called when the escape key is pressed.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_nav_select" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#438-440">Source</a><h4 class="code-header">fn <a href="#method.on_nav_select" class="fn">on_nav_select</a>(&mut self, id: <a class="type" href="../widget/nav_bar/type.Id.html" title="type cosmic::widget::nav_bar::Id">Id</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Called when a navigation item is selected.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_nav_context" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#443-445">Source</a><h4 class="code-header">fn <a href="#method.on_nav_context" class="fn">on_nav_context</a>(&mut self, id: <a class="type" href="../widget/nav_bar/type.Id.html" title="type cosmic::widget::nav_bar::Id">Id</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Called when a context menu is requested for a navigation item.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_search" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#448-450">Source</a><h4 class="code-header">fn <a href="#method.on_search" class="fn">on_search</a>(&mut self) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Called when the search function is requested.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.on_window_resize" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#453">Source</a><h4 class="code-header">fn <a href="#method.on_window_resize" class="fn">on_window_resize</a>(&mut self, id: <a class="struct" href="../iced/window/struct.Id.html" title="struct cosmic::iced::window::Id">Id</a>, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>, height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>)</h4></section></summary><div class="docblock"><p>Called when a window is resized.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.subscription" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#456-458">Source</a><h4 class="code-header">fn <a href="#method.subscription" class="fn">subscription</a>(&self) -> <a class="struct" href="../iced/struct.Subscription.html" title="struct cosmic::iced::Subscription">Subscription</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Event sources that are to be listened to.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.update" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#461-463">Source</a><h4 class="code-header">fn <a href="#method.update" class="fn">update</a>(&mut self, message: Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Respond to an application-specific message.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.system_theme_update" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#466-472">Source</a><h4 class="code-header">fn <a href="#method.system_theme_update" class="fn">system_theme_update</a>(
|
||
&mut self,
|
||
keys: &[&'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>],
|
||
new_theme: &<a class="struct" href="../cosmic_theme/struct.Theme.html" title="struct cosmic::cosmic_theme::Theme">Theme</a>,
|
||
) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Respond to a system theme change</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.system_theme_mode_update" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#475-481">Source</a><h4 class="code-header">fn <a href="#method.system_theme_mode_update" class="fn">system_theme_mode_update</a>(
|
||
&mut self,
|
||
keys: &[&'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>],
|
||
new_theme: &<a class="struct" href="../cosmic_theme/struct.ThemeMode.html" title="struct cosmic::cosmic_theme::ThemeMode">ThemeMode</a>,
|
||
) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Respond to a system theme mode change</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.view_window" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#487-489">Source</a><h4 class="code-header">fn <a href="#method.view_window" class="fn">view_window</a>(&self, id: <a class="struct" href="../iced/window/struct.Id.html" title="struct cosmic::iced::window::Id">Id</a>) -> <a class="type" href="../type.Element.html" title="type cosmic::Element">Element</a><'_, Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section></summary><div class="docblock"><p>Constructs views for other windows.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.style" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#492-494">Source</a><h4 class="code-header">fn <a href="#method.style" class="fn">style</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../iced/daemon/program/graphics/core/theme/struct.Style.html" title="struct cosmic::iced::daemon::program::graphics::core::theme::Style">Style</a>></h4></section></summary><div class="docblock"><p>Overrides the default style for applications</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.dbus_activation" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#498-500">Source</a><h4 class="code-header">fn <a href="#method.dbus_activation" class="fn">dbus_activation</a>(&mut self, msg: <a class="struct" href="../dbus_activation/struct.Message.html" title="struct cosmic::dbus_activation::Message">Message</a>) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>single-instance</code></strong> only.</div></span></summary><div class="docblock"><p>Handles dbus activation messages</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.dbus_connection" class="method"><a class="src rightside" href="../../src/cosmic/app/mod.rs.html#506-508">Source</a><h4 class="code-header">fn <a href="#method.dbus_connection" class="fn">dbus_connection</a>(&mut self, conn: Connection) -> <a class="type" href="type.Task.html" title="type cosmic::app::Task">Task</a><Self::<a class="associatedtype" href="../trait.Application.html#associatedtype.Message" title="type cosmic::Application::Message">Message</a>></h4></section><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>single-instance</code></strong> only.</div></span></summary><div class="docblock"><p>Invoked on connect to dbus session socket used for dbus activation</p>
|
||
<p>Can be used to expose custom interfaces on the same owned name.</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"></div><script src="../../trait.impl/cosmic/app/trait.Application.js" async></script><script type="text/json" id="notable-traits-data">{"Vec<Element<'_, Self::Message>>":"<h3>Notable traits for <code><a class=\"struct\" href=\"../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html\" title=\"struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A></code></h3><pre><code><div class=\"where\">impl<A> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html\" title=\"struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>, A><div class=\"where\">where\n A: <a class=\"trait\" href=\"../cctk/sctk/reexports/client/backend/smallvec/alloc/alloc/trait.Allocator.html\" title=\"trait cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::alloc::Allocator\">Allocator</a>,</div></div>"}</script></section></div></main></body></html> |